Ubuntu 16.04 reboot and shutdown hanging on LVM metadata daemon

Written by - 0 comments

Published on May 5th 2017 - Listed in Linux

I've seen this problem already for a couple of months now, basically since we first started to install Ubuntu 16.04 Xenial machines. When a reboot or a shutdown was launched, the system kept hanging. In the VM console the last entry was either on

[ OK ] Stopped LVM2 metadata daemon.

Xenial Reboot hanging

or on

[ *** ] A start job is running for Unattended Upgrades Shutdown (1min 27s / no limit)

Xenial reboot hanging

At the begin I always suspected some problem in the LVM settings. All the affected machines were either clones from another VM or a new VM deployed from a template. In /etc/lvm/backup/VGNAME I saw the name of the template appeared.

But further research shows it is a problem in the unattended-upgrade package. In Ubuntu bug #1654600 it is reported that this shutdown hanging happens when /var is a separate file system and LVM is being used; which is the case on almost all our machines. As of this writing (May 5th 2017) a fix of the unattended-upgrades package is in the pipeline (Fix Committed) but not yet released.

An immediate workaround was found in Ubuntu bug #1661611, which is marked as duplicate of #1654600:

 - fix /usr/share/unattended-upgrades/unattended-upgrades-shutdown to expect "false" instead of "False"

# sed -n "120p" /usr/share/unattended-upgrades/unattended-upgrade-shutdown
    if apt_pkg.config.find_b("Unattended-Upgrade::InstallOnShutdown", False):

# sed -i "120s/False/false/" /usr/share/unattended-upgrades/unattended-upgrade-shutdown

# sed -n "120p" /usr/share/unattended-upgrades/unattended-upgrade-shutdown
    if apt_pkg.config.find_b("Unattended-Upgrade::InstallOnShutdown", false):

But this only "works" because the Python syntax is incorrect now (Python wants "False", not "false"):

So this is not advisable either (although it saves you a 10 minute wait until your machine reboots). Best solution is to wait for the definitive fix of bug #1654600 (or in the meantime uninstall the unattended-upgrade package).

Update May 10th 2017:
I just checked the current status of the unattended-upgrade package and version 0.90ubuntu0.5 (which contains the fix) was released and can now be installed.

Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.