new initctl should fallback to old reload signal semantics, if pid1 doesn't export reload dbus method

Bug #1303891 reported by Dimitri John Ledkov
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
upstart
Fix Committed
High
Unassigned
upstart (Ubuntu)
Fix Released
High
Dimitri John Ledkov
Trusty
Fix Released
High
Dimitri John Ledkov

Bug Description

[Impact]

 * Between upgrading upstart to trusty and rebooting: reload (initctl reload) commands fail and do not SIGHUP upstart jobs.

[Test Case]

 * with pid1 being precise init, attempt to perform $ initctl reload against any job using trusty's initctl

[Regression Potential]

 * Minimal, this re-introduces a previously removed code-path as fallback when reload signal delivery fails.

[Other Info]

 * original bug report below

new initctl should fallback to old reload signal semantics, if pid1 doesn't export reload dbus method

as per comment https://bugs.launchpad.net/upstart/+bug/893021/comments/2

I'm currently testing Precise to Trusty upgrades and encountered - while troubleshooting bug http://pad.lv/1301962 - this issue:
# initctl reload dbus
initctl: Method "Reload" with signature "" on interface "com.ubuntu.Upstart0_6.Instance" doesn't exist

The issue at hand is that during the upgrade the 'upstart' package will be updated but Precise's Upstart is still running until a reboot. Trusty's 'upstart' package ships a new 'initctl' binary that handles reloads only via the 'Reload' D-Bus method. Precise's Upstart doesn't support the 'Reload' D-Bus method though.

Can Trusty's initctl binary be patched so that it falls back to the previous reload behavior if the Upstart version in use doesn't support the 'Reload' D-Bus method?
Would you like me to open a new bug for this issue?

Related branches

Changed in upstart:
assignee: nobody → Dimitri John Ledkov (xnox)
status: New → Triaged
importance: Undecided → High
Changed in upstart (Ubuntu):
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Dimitri John Ledkov (xnox)
description: updated
Changed in upstart:
status: Triaged → Fix Committed
description: updated
Revision history for this message
Michael Schaller (misch-9) wrote :

Sorry for being impatient but when can I expect the fixed package to be available?

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

The packages are currently building.

Changed in upstart (Ubuntu Trusty):
status: Confirmed → Fix Committed
Revision history for this message
Michael Schaller (misch-9) wrote :

Then I'll test it on Monday.

Thanks for fixing it so quickly. ;-)
Wish you a nice weekend.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package upstart - 1.12.1-0ubuntu4

---------------
upstart (1.12.1-0ubuntu4) trusty; urgency=medium

  [ Adam Conrad ]
  * Disable chroot sessions by default, add an option to enable chroot
    sessions. (LP: #1277594)
 -- Dimitri John Ledkov <email address hidden> Fri, 11 Apr 2014 22:31:21 +0100

Changed in upstart (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Michael Schaller (misch-9) wrote :

I've tested the new packages and I'm hitting a new issue:

$ sudo initctl reload dbus ; echo "exit code: $?"
initctl: Not running
exit code: 1

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

misch-9:
"initct: Not running" is a different error messages, it means dbus is not running / there is no main daemon process.

I've run 12.04 live cd, installed upstart from trusty and verified this bug report like so:

$ sudo -i
# initctl version
init (upstart 1.5)
// pid1 is precise upstart
# inictl --version
initctl (upstart 1.12.1)
// initctl is from trusty
# initctl status dbus
dbus start/running, process 1221
// dbus _is_ running
# initctl reload dbus
# echo $?
0
// reload is successful

Revision history for this message
Michael Schaller (misch-9) wrote :

Thank you Dimitri for the commands. I'll check what's going on in my VM...

Revision history for this message
Michael Schaller (misch-9) wrote :

And here are the details from my VM:

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.4 LTS"

# dpkg -l | egrep -v '^rc|^ii'
<no output; all packages are healthy>

# dpkg -l | grep upstart
ii upstart 1.5-0ubuntu7.2 event-based init daemon

# initctl version
init (upstart 1.5)

# initctl --version
initctl (upstart 1.5)

# initctl status dbus
dbus start/running, process 699

# ps ax | grep dbus-daemon | grep system
  699 ? Ss 0:00 dbus-daemon --system --fork --activation=upstart

# initctl reload dbus ; echo "exit code: $?"
exit code: 0

>>> apt-get dist-upgrade; apt-get install -f; ...

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"

# dpkg -l | egrep -v '^rc|^ii'
iF bluez 4.101-0ubuntu13 amd64 Bluetooth tools and daemons
iU gnome-bluetooth 3.8.2.1-0ubuntu4 amd64 GNOME Bluetooth tools
iU gnome-user-share 3.0.4-0ubuntu1 amd64 User level public file sharing via WebDAV or ObexFTP
iU indicator-bluetooth 0.0.6+14.04.20140207-0ubuntu2 amd64 System bluetooth indicator.

# dpkg -l | grep upstart
ii libupstart1:amd64 1.12.1-0ubuntu4 amd64 Upstart Client Library
ii upstart 1.12.1-0ubuntu4 amd64 event-based init daemon

# initctl version
init (upstart 1.5)

# initctl --version
initctl (upstart 1.12.1)

# initctl status dbus
dbus start/running

# ps ax | grep dbus-daemon | grep system
  699 ? Ss 0:01 dbus-daemon --system --fork --activation=upstart

# initctl reload dbus ; echo "exit code: $?"
initctl: Not running
exit code: 1

>>> The dist-upgrade/dpkg output doesn't show any irregularities regarding dbus though:
Setting up dbus (1.6.18-0ubuntu4) ...
Installing new version of config file /etc/init/dbus.conf ...
dbus start/running

Dimitri, to me it looks like as if Upstart lost track of the dbus process during the dist-upgrade.
What do you think?

Revision history for this message
Michael Schaller (misch-9) wrote :

Friendly ping to Dimitri.
Dimitri, should I open a new bug for the new issue I've reported in comment #5 and #8?

Revision history for this message
Michael Schaller (misch-9) wrote :

Dimitri, I've found the issue! The installation of the libselinux1 package during the dist-upgrade from Precise to Trusty causes this issue!

Here are the details from a freshly installed Ubuntu 12.04.4 amd64 VM:
$ sudo apt-get update -qq && sudo apt-get dist-upgrade -qqy
<no output; no updates>

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.4 LTS"

$ initctl --version
initctl (upstart 1.5)

$ initctl version
init (upstart 1.5)

$ initctl list
avahi-daemon start/running, process 765
...

$ sudo sed -i 's/precise/trusty/g' /etc/apt/sources.list

$ sudo apt-get update -qq
<no ouput; no errors>

$ sudo apt-get install libselinux1 -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  libselinux1
1 upgraded, 0 newly installed, 0 to remove and 1250 not upgraded.
Need to get 58.0 kB of archives.
After this operation, 2,048 B of additional disk space will be used.
Get:1 http://de.archive.ubuntu.com/ubuntu/ trusty/main libselinux1 amd64 2.2.2-1 [58.0 kB]
Fetched 58.0 kB in 0s (330 kB/s)
(Reading database ... 174854 files and directories currently installed.)
Preparing to replace libselinux1 2.1.0-4.1ubuntu1 (using .../libselinux1_2.2.2-1_amd64.deb) ...
Unpacking replacement libselinux1 ...
Setting up libselinux1 (2.2.2-1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

New dmesg lines:
[ 256.032898] init: Re-executing /sbin/init

New syslog lines:
Apr 23 14:51:40 test upstart-socket-bridge[1090]: Disconnected from Upstart
Apr 23 14:51:40 test upstart-udev-bridge[595]: Disconnected from Upstart

$ initctl list
avahi-daemon stop/waiting
...

Revision history for this message
Michael Schaller (misch-9) wrote :

Workaround:
Before doing the dist-upgrade update the upstart package. Trusty's upstart package has no issues with Trusty's libselinux1 package.

Revision history for this message
Michael Schaller (misch-9) wrote :

As I've haven't heard back from Dimitri I've opened a bug against libselinux1 to add at least a Breaks to its debian/control file:
https://bugs.launchpad.net/ubuntu/+source/libselinux/+bug/1313712

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Very sorry for the delay in response here, it got lost in piles of my bug mail. I've responded on the libselinux bug report. It is valid, and I will get that SRUed into trusty as soon as possible.

Revision history for this message
Michael Schaller (misch-9) wrote :

Dimitri, no worries. I guess everybody at Canonical is swamped with work so close to a release date. ;-)
Thank you for taking care of the other bug, too.

Changed in upstart:
assignee: Dimitri John Ledkov (xnox) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.