Public bug reported:

If required package libnih1 (or libnih-dbus1) are upgraded, Upstart
needs to be restarted to avoid it holding open "stale" file descriptors
to files in the old versions of the packages. This results in the
following issues:

- the shutdown sequence displays error messages.
- the shutdown sequence results in an unclean unmount of the root partition.
- the subsequent boot experience is slowed down and may show potentially 
alarming messages to users.

All this amounts to a non-optimal user experience.

See original bug 740390.


= Fix =

The fix released for quantal on bug 740390 is to add an explicit
debian/libnih1.postinst and debian/libnih-dbus1.postinst maintainer
script that simply touches a 'magic file' that forces upstart to restart
on shutdown. The magic file is:

    /var/run/init.upgraded

This magic file is used by /etc/init.d/umountroot as a signal to ask
Upstart to re-exec itself and thus relinquish all "stale" file
descriptors it may have open.

The magic file is already used by:

- libdbus (package dbus): recent change - see bug 740390
- libc6 (package eglibc): since 2011-01-12.


= Justification for Back-Porting =

The fix is simple and has already been released to quantal.


= Test Case =

1) Boot a Precise system without the 'quiet' and 'splash' boot options.

2) Check version of libnih1 is 1.0.3-4ubuntu9:

     $ dpkg -p libnih1 libnih-dbus1|grep ^Version:

3) force a re-install of libnih1:

    $ sudo apt-get install --reinstall libnih1 libnih-dbus1

4) Add a sleep to /etc/init.d/umountroot so you can observe any possible
error message:

  --- /etc/init.d/umountroot.ORIG 2012-10-05 11:48:40.384382009 +0100
+++ /etc/init.d/umountroot      2012-10-05 11:48:55.024382058 +0100
@@ -86,6 +86,7 @@
        mount    $MOUNT_FORCE_OPT -n -o remount,ro -t dummytype dummydev / 
2>/dev/null \
        || mount $MOUNT_FORCE_OPT -n -o remount,ro              dummydev / 
2>/dev/null \
        || mount $MOUNT_FORCE_OPT -n -o remount,ro                       /
+       sleep 5
        ES=$?
        [ "$VERBOSE" = no ] || log_action_end_msg $ES
 }

5) Shutdown

    $ sudo shutdown -h now

6) Ensure you see the expected error message. The last 2 lines of output
should be:

     umount: /run/lock: not mounted
     mount: / is busy

   (Note that the 'umount' message is not an error - just
informational).

7) Reboot again without the 'quiet' and 'splash' boot options.

8) Install libnih1 and lib-dbus1 both at version '1.0.3-4ubuntu9.1'.

9) Check that install has created the expected magic file:

    ls -l /var/run/init.upgraded

10) Shutdown

    $ sudo shutdown -h now

11) Ensure you see the expected output. The last line of output should
be:

     umount: /run/lock: not mounted

     There should be no 'mount: / is busy' line.

12) Reboot and revert changes to /etc/init.d/umountroot if desired.


= Regression Potential =

No regression potential.

** Affects: libnih (Ubuntu)
     Importance: Medium
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1062202

Title:
  [SRU] libnih upgrade does not respawn init, resulting in unclean
  shutdown

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libnih/+bug/1062202/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to