Trusty's libselinux1 causes issues with Precise's upstart during dist-upgrade

Bug #1313712 reported by Michael Schaller
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libselinux (Ubuntu)
Fix Released
High
Dimitri John Ledkov
Trusty
Fix Released
High
Dimitri John Ledkov
Utopic
Fix Released
High
Dimitri John Ledkov

Bug Description

[Impact]

 * During upgrade to trusty, upstart would be forcefully re-executed, even if it doesn't support stateful re-execution. This means all job statuses is lost.

 * Upgrade strategy for upstart is that when stateful re-execution is not supported, a flag should be left to re-execute upstart on shut-down only.

 * The culprit is in libselinux1, a new dependency of upstart in trusty that does not have appropriate login in its postinst.

[Test Case]

 * Using precise's upstart as pid one execute:
$ initctl list

 * Install libselinux1 from trusty-proposed
 * Execute
$ initctl list

 * The two lists should be largely the same, with state of jobs preserved.
 * /var/run/init.upgraded file-flag should be present.

[Other Info]

 * Original bug report:

Hi everyone,

During troubleshooting of bug http://pad.lv/1303891 I've also discovered that Precise's upstart version doesn't work with Trusty's libselinux1. This is a major issue during a dist-upgrade from Precise to Trusty as upstart is severely affected by this and looses track of service PIDs which prevents service reloads.

Can someone add a Breaks for Precise's upstart version to Trusty's libselinux1 debian/control file?

Reproduction instructions:
Install Ubuntu 12.04.4.

$ sudo apt-get update -qq && sudo apt-get dist-upgrade -qqy
<no output; no updates>

$ 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
...

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
...

Upstart lost track of service PIDs. Commands like 'initctl reload dbus' will fail.

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

upstart in precise does not link/use libselinux, nor supports stateful re-execution.
If one re-execs precise's upstart, it looses state of all jobs.
upstart in trusty does support stateful re-execution and links against libselinux.
I'll inspect libselinux post-install scripts, but it should only re-execute upstart if and only if "initctl version" is > 1.10

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

if [ "$1" = "configure" ]; then
       # Restart init. If it fails, there is nothing we can do, so
      # just ignore the error (NOTE: Borrowed from libc6.postinst)
      telinit u 2>/dev/null || true ; sleep 1
 9fi

ph, yes, libselinux postinst is not upgrades from precise friendly.

Changed in libselinux (Ubuntu Trusty):
status: New → Confirmed
status: Confirmed → Triaged
Changed in libselinux (Ubuntu Utopic):
status: New → Triaged
Changed in libselinux (Ubuntu Trusty):
importance: Undecided → High
Changed in libselinux (Ubuntu Utopic):
importance: Undecided → High
assignee: nobody → Dimitri John Ledkov (xnox)
Changed in libselinux (Ubuntu Trusty):
assignee: nobody → Dimitri John Ledkov (xnox)
summary: - Trusty's libselinux1 is causes issues with Precise's upstart during
- dist-upgrade
+ Trusty's libselinux1 causes issues with Precise's upstart during dist-
+ upgrade
description: updated
Changed in libselinux (Ubuntu Utopic):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libselinux - 2.2.2-1ubuntu1

---------------
libselinux (2.2.2-1ubuntu1) utopic; urgency=high

  * Correct libselinu1 postinst for re-executing upstart. (LP: #1313712)
  * Fix FTBFS against ruby2.1.
 -- Dimitri John Ledkov <email address hidden> Mon, 28 Apr 2014 14:51:48 +0100

Changed in libselinux (Ubuntu Utopic):
status: In Progress → Fix Released
Changed in libselinux (Ubuntu Trusty):
status: Triaged → In Progress
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Michael, or anyone else affected,

Accepted libselinux into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/libselinux/2.2.2-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

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

$ apt-cache policy libselinux1
libselinux1:
  Installed: 2.1.0-4.1ubuntu1
  Candidate: 2.2.2-1ubuntu0.1
  Version table:
     2.2.2-1ubuntu0.1 0
        500 http://de.archive.ubuntu.com/ubuntu/ trusty-proposed/main amd64 Packages
     2.2.2-1 0
        500 http://de.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
 *** 2.1.0-4.1ubuntu1 0
        100 /var/lib/dpkg/status

> Took snapshot of VM

$ sudo apt-get install libselinux1=2.2.2-1
...

$ initctl list | grep process
<no output>

> Issue present in version 2.2.2-1
> Reverted to snapshot of VM

$ sudo apt-get install libselinux1=2.2.2-1ubuntu0.1
...

$ initctl list | grep process
avahi-daemon start/running, process 732
rsyslog start/running, process 685
tty4 start/running, process 1222
...

> Issue is fixed in version 2.2.2-1ubuntu0.1

tags: added: verification-done
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libselinux - 2.2.2-1ubuntu0.1

---------------
libselinux (2.2.2-1ubuntu0.1) trusty; urgency=high

  * Correct libselinu1 postinst for re-executing upstart. (LP: #1313712)
 -- Dimitri John Ledkov <email address hidden> Mon, 28 Apr 2014 14:51:48 +0100

Changed in libselinux (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for libselinux has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

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

Thank you Dimitri for fixing this issue.

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.