Activity log for bug #1803137

Date Who What changed Old value New value Message
2018-11-13 13:51:59 Balint Reczey bug added bug
2018-11-13 13:52:05 Balint Reczey unattended-upgrades (Ubuntu): assignee Balint Reczey (rbalint)
2018-11-13 13:52:23 Balint Reczey unattended-upgrades (Ubuntu): status New Fix Released
2018-11-13 16:31:42 Balint Reczey description [Impact] * Unattended-upgrades may keep running during shutdown even beyond unmounting local filesystems potentially leaving a broken installation behind. * The fix reverts the original fix of LP: #1778219 and applies a different one startin unattended-upgrades-shutdown _before_ the shutdown transaction starts/ [Test Case] * Run unattended-upgrades in InstallOnShutdown mode and observe it being finished installing a few packages _before_ the shutdown transaction starts: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:50:10 cc-uu-shutdown systemd[1]: Started Unattended Upgrades Shutdown. Nov 13 12:51:17 cc-uu-shutdown systemd-logind[228]: System is rebooting. ... root@cc-uu-shutdown:~# cat /var/log/unattended-upgrades/unattended-upgrades-shutdown.log ... 2018-11-13 12:51:13,835 WARNING - Running unattended-upgrades in shutdown mode 2018-11-13 12:51:13,852 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:15,482 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,151 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,166 INFO - All upgrades installed [Regression Potential] * The change reverts the behavior of unattended-upgrades-shutdown to be close to the behavior observed in Ubuntu 18.04, blocking the shutdown process reliably until is unattended-upgrades finished, but it starts _before_ shutdown triggered by the PrepareForShutdown() signal. Due to the shutdown not fully starting yet users may not get visual notification of unattended-upgrades running in some system configuration (testing that is WIP). * The reversion of unattended-upgrades.service was not complete in u-u 1.7 and needed a further fix in 1.7ubuntu1 (which fix is already included in 1.5ubuntu4). This part may be source of potential regressions. * The fix itself rewrites big part of unattended-upgrades-shutdown and this rewrite could cause regressions in running unattended-upgrades in InstallOnShutdown mode, but also this mode was extensively tested. * The fix includes increasing logind's InhibitDelayMaxSec to 30s to give u-u enough time to gracefully stop in normal mode and install packages in InstallOnShutdown mode. The delay is global, thus any other program holding the lock can delay shutdown or sleep by 30s instead of the original 5s default. This regression is hard to avoid and the 30s was chosen to minimize the regression potential while still giving more than 5s to u-u to finish actions. Bugs reporting increased delay to sleep or shutdown should be monitored to catch other programs misbehaving with this new default. [Other Info] This is a regression of introduced in LP: #1778219 and can be observed in a cosmic lxd container easily: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Stopped target Local File Systems. Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: unattended-upgrades.service: Failed to reset devices.list: Operation not permitted Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Starting Unattended Upgrades Shutdown... .. [Impact]  * Unattended-upgrades may keep running during shutdown even beyond unmounting local filesystems potentially leaving a broken installation behind.  * The fix reverts the original fix of LP: #1778219 and applies a different one startin unattended-upgrades-shutdown _before_ the shutdown transaction starts/ [Test Case]  * Run unattended-upgrades in InstallOnShutdown mode and observe it being finished installing a few packages _before_ the shutdown transaction starts: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:50:10 cc-uu-shutdown systemd[1]: Started Unattended Upgrades Shutdown. Nov 13 12:51:17 cc-uu-shutdown systemd-logind[228]: System is rebooting. ... root@cc-uu-shutdown:~# cat /var/log/unattended-upgrades/unattended-upgrades-shutdown.log ... 2018-11-13 12:51:13,835 WARNING - Running unattended-upgrades in shutdown mode 2018-11-13 12:51:13,852 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:15,482 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,151 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,166 INFO - All upgrades installed [Regression Potential]  * The change reverts the behavior of unattended-upgrades-shutdown to be close to the behavior observed in Ubuntu 18.04, blocking the shutdown process reliably until is unattended-upgrades finished, but it starts _before_ shutdown triggered by the PrepareForShutdown() signal. Due to the shutdown not fully starting yet users may not get visual notification of unattended-upgrades running. In my testing when a logged-in user shuts down the system when InstallOnShutdown is configured the user is dropped out to the login manager and nothing shows that u-u is running behind the screens for 30s, when the inhibition timer expires and u-u is starting to gracefully stop and the usual text appears after the login manager exits and plymouth shutdown screen is shown. The fix would be the login manager also monitoring PrepareForShutdown() and exiting.  * The reversion of unattended-upgrades.service was not complete in u-u 1.7 and needed a further fix in 1.7ubuntu1 (which fix is already included in 1.5ubuntu4). This part may be source of potential regressions.  * The fix itself rewrites big part of unattended-upgrades-shutdown and this rewrite could cause regressions in running unattended-upgrades in InstallOnShutdown mode, but also this mode was extensively tested.  * The fix includes increasing logind's InhibitDelayMaxSec to 30s to give u-u enough time to gracefully stop in normal mode and install packages in InstallOnShutdown mode. The delay is global, thus any other program holding the lock can delay shutdown or sleep by 30s instead of the original 5s default. This regression is hard to avoid and the 30s was chosen to minimize the regression potential while still giving more than 5s to u-u to finish actions. Bugs reporting increased delay to sleep or shutdown should be monitored to catch other programs misbehaving with this new default. [Other Info] This is a regression of introduced in LP: #1778219 and can be observed in a cosmic lxd container easily: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Stopped target Local File Systems. Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: unattended-upgrades.service: Failed to reset devices.list: Operation not permitted Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Starting Unattended Upgrades Shutdown... ..
2018-11-13 23:12:22 Balint Reczey description [Impact]  * Unattended-upgrades may keep running during shutdown even beyond unmounting local filesystems potentially leaving a broken installation behind.  * The fix reverts the original fix of LP: #1778219 and applies a different one startin unattended-upgrades-shutdown _before_ the shutdown transaction starts/ [Test Case]  * Run unattended-upgrades in InstallOnShutdown mode and observe it being finished installing a few packages _before_ the shutdown transaction starts: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:50:10 cc-uu-shutdown systemd[1]: Started Unattended Upgrades Shutdown. Nov 13 12:51:17 cc-uu-shutdown systemd-logind[228]: System is rebooting. ... root@cc-uu-shutdown:~# cat /var/log/unattended-upgrades/unattended-upgrades-shutdown.log ... 2018-11-13 12:51:13,835 WARNING - Running unattended-upgrades in shutdown mode 2018-11-13 12:51:13,852 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:15,482 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,151 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,166 INFO - All upgrades installed [Regression Potential]  * The change reverts the behavior of unattended-upgrades-shutdown to be close to the behavior observed in Ubuntu 18.04, blocking the shutdown process reliably until is unattended-upgrades finished, but it starts _before_ shutdown triggered by the PrepareForShutdown() signal. Due to the shutdown not fully starting yet users may not get visual notification of unattended-upgrades running. In my testing when a logged-in user shuts down the system when InstallOnShutdown is configured the user is dropped out to the login manager and nothing shows that u-u is running behind the screens for 30s, when the inhibition timer expires and u-u is starting to gracefully stop and the usual text appears after the login manager exits and plymouth shutdown screen is shown. The fix would be the login manager also monitoring PrepareForShutdown() and exiting.  * The reversion of unattended-upgrades.service was not complete in u-u 1.7 and needed a further fix in 1.7ubuntu1 (which fix is already included in 1.5ubuntu4). This part may be source of potential regressions.  * The fix itself rewrites big part of unattended-upgrades-shutdown and this rewrite could cause regressions in running unattended-upgrades in InstallOnShutdown mode, but also this mode was extensively tested.  * The fix includes increasing logind's InhibitDelayMaxSec to 30s to give u-u enough time to gracefully stop in normal mode and install packages in InstallOnShutdown mode. The delay is global, thus any other program holding the lock can delay shutdown or sleep by 30s instead of the original 5s default. This regression is hard to avoid and the 30s was chosen to minimize the regression potential while still giving more than 5s to u-u to finish actions. Bugs reporting increased delay to sleep or shutdown should be monitored to catch other programs misbehaving with this new default. [Other Info] This is a regression of introduced in LP: #1778219 and can be observed in a cosmic lxd container easily: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Stopped target Local File Systems. Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: unattended-upgrades.service: Failed to reset devices.list: Operation not permitted Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Starting Unattended Upgrades Shutdown... .. [Impact]  * Unattended-upgrades may keep running during shutdown even beyond unmounting local filesystems potentially leaving a broken installation behind.  * The fix reverts the original fix of LP: #1778219 and applies a different one startin unattended-upgrades-shutdown _before_ the shutdown transaction starts/ [Test Case]  * Run unattended-upgrades in InstallOnShutdown mode and observe it being finished installing a few packages _before_ the shutdown transaction starts: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:50:10 cc-uu-shutdown systemd[1]: Started Unattended Upgrades Shutdown. Nov 13 12:51:17 cc-uu-shutdown systemd-logind[228]: System is rebooting. ... root@cc-uu-shutdown:~# cat /var/log/unattended-upgrades/unattended-upgrades-shutdown.log ... 2018-11-13 12:51:13,835 WARNING - Running unattended-upgrades in shutdown mode 2018-11-13 12:51:13,852 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:15,482 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,151 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,166 INFO - All upgrades installed [Regression Potential]  * The change reverts the behavior of unattended-upgrades-shutdown to be close to the behavior observed in Ubuntu 18.04, blocking the shutdown process reliably until is unattended-upgrades finished, but it starts _before_ shutdown triggered by the PrepareForShutdown() signal. Due to the shutdown not fully starting yet users may not get visual notification of unattended-upgrades running. In my testing on Bionic when a logged-in user shuts down the system when InstallOnShutdown is configured the user is dropped out to the login manager and nothing shows that u-u is running behind the screens for 30s, when the inhibition timer expires and u-u is starting to gracefully stop and the usual text appears after the login manager exits and plymouth shutdown screen is shown. The fix would be the login manager also monitoring PrepareForShutdown() and exiting. On Xenial (with Unity) starting shutdown from the graphical session does not log the user out nor show any progress on the shutdown until the inhibition timer expires which is confusing. Users should be logged out on PrepareForShutdown().  * The reversion of unattended-upgrades.service was not complete in u-u 1.7 and needed a further fix in 1.7ubuntu1 (which fix is already included in 1.5ubuntu4). This part may be source of potential regressions.  * The fix itself rewrites big part of unattended-upgrades-shutdown and this rewrite could cause regressions in running unattended-upgrades in InstallOnShutdown mode, but also this mode was extensively tested.  * The fix includes increasing logind's InhibitDelayMaxSec to 30s to give u-u enough time to gracefully stop in normal mode and install packages in InstallOnShutdown mode. The delay is global, thus any other program holding the lock can delay shutdown or sleep by 30s instead of the original 5s default. This regression is hard to avoid and the 30s was chosen to minimize the regression potential while still giving more than 5s to u-u to finish actions. Bugs reporting increased delay to sleep or shutdown should be monitored to catch other programs misbehaving with this new default. [Other Info] This is a regression of introduced in LP: #1778219 and can be observed in a cosmic lxd container easily: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Stopped target Local File Systems. Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: unattended-upgrades.service: Failed to reset devices.list: Operation not permitted Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Starting Unattended Upgrades Shutdown... ..
2018-11-15 15:05:27 Balint Reczey description [Impact]  * Unattended-upgrades may keep running during shutdown even beyond unmounting local filesystems potentially leaving a broken installation behind.  * The fix reverts the original fix of LP: #1778219 and applies a different one startin unattended-upgrades-shutdown _before_ the shutdown transaction starts/ [Test Case]  * Run unattended-upgrades in InstallOnShutdown mode and observe it being finished installing a few packages _before_ the shutdown transaction starts: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:50:10 cc-uu-shutdown systemd[1]: Started Unattended Upgrades Shutdown. Nov 13 12:51:17 cc-uu-shutdown systemd-logind[228]: System is rebooting. ... root@cc-uu-shutdown:~# cat /var/log/unattended-upgrades/unattended-upgrades-shutdown.log ... 2018-11-13 12:51:13,835 WARNING - Running unattended-upgrades in shutdown mode 2018-11-13 12:51:13,852 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:15,482 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,151 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,166 INFO - All upgrades installed [Regression Potential]  * The change reverts the behavior of unattended-upgrades-shutdown to be close to the behavior observed in Ubuntu 18.04, blocking the shutdown process reliably until is unattended-upgrades finished, but it starts _before_ shutdown triggered by the PrepareForShutdown() signal. Due to the shutdown not fully starting yet users may not get visual notification of unattended-upgrades running. In my testing on Bionic when a logged-in user shuts down the system when InstallOnShutdown is configured the user is dropped out to the login manager and nothing shows that u-u is running behind the screens for 30s, when the inhibition timer expires and u-u is starting to gracefully stop and the usual text appears after the login manager exits and plymouth shutdown screen is shown. The fix would be the login manager also monitoring PrepareForShutdown() and exiting. On Xenial (with Unity) starting shutdown from the graphical session does not log the user out nor show any progress on the shutdown until the inhibition timer expires which is confusing. Users should be logged out on PrepareForShutdown().  * The reversion of unattended-upgrades.service was not complete in u-u 1.7 and needed a further fix in 1.7ubuntu1 (which fix is already included in 1.5ubuntu4). This part may be source of potential regressions.  * The fix itself rewrites big part of unattended-upgrades-shutdown and this rewrite could cause regressions in running unattended-upgrades in InstallOnShutdown mode, but also this mode was extensively tested.  * The fix includes increasing logind's InhibitDelayMaxSec to 30s to give u-u enough time to gracefully stop in normal mode and install packages in InstallOnShutdown mode. The delay is global, thus any other program holding the lock can delay shutdown or sleep by 30s instead of the original 5s default. This regression is hard to avoid and the 30s was chosen to minimize the regression potential while still giving more than 5s to u-u to finish actions. Bugs reporting increased delay to sleep or shutdown should be monitored to catch other programs misbehaving with this new default. [Other Info] This is a regression of introduced in LP: #1778219 and can be observed in a cosmic lxd container easily: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Stopped target Local File Systems. Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: unattended-upgrades.service: Failed to reset devices.list: Operation not permitted Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Starting Unattended Upgrades Shutdown... .. [Impact]  * Unattended-upgrades may keep running during shutdown even beyond unmounting local filesystems potentially leaving a broken installation behind.  * The fix reverts the original fix of LP: #1778219 and applies a different one starting unattended-upgrades-shutdown _before_ the shutdown transaction starts/ [Test Case]  * Run unattended-upgrades in InstallOnShutdown mode and observe it being finished installing a few packages _before_ the shutdown transaction starts: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:50:10 cc-uu-shutdown systemd[1]: Started Unattended Upgrades Shutdown. Nov 13 12:51:17 cc-uu-shutdown systemd-logind[228]: System is rebooting. ... root@cc-uu-shutdown:~# cat /var/log/unattended-upgrades/unattended-upgrades-shutdown.log ... 2018-11-13 12:51:13,835 WARNING - Running unattended-upgrades in shutdown mode 2018-11-13 12:51:13,852 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:15,482 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,151 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,166 INFO - All upgrades installed [Regression Potential]  * The change reverts the behavior of unattended-upgrades-shutdown to be close to the behavior observed in Ubuntu 18.04, blocking the shutdown process reliably until is unattended-upgrades finished, but it starts _before_ shutdown triggered by the PrepareForShutdown() signal. Due to the shutdown not fully starting yet users may not get visual notification of unattended-upgrades running. In my testing on Bionic when a logged-in user shuts down the system when InstallOnShutdown is configured the user is dropped out to the login manager and nothing shows that u-u is running behind the screens for 30s, when the inhibition timer expires and u-u is starting to gracefully stop and the usual text appears after the login manager exits and plymouth shutdown screen is shown. The fix would be the login manager also monitoring PrepareForShutdown() and exiting. On Xenial (with Unity) starting shutdown from the graphical session does not log the user out nor show any progress on the shutdown until the inhibition timer expires which is confusing. Users should be logged out on PrepareForShutdown().  * The reversion of unattended-upgrades.service was not complete in u-u 1.7 and needed a further fix in 1.7ubuntu1 (which fix is already included in 1.5ubuntu4). This part may be source of potential regressions.  * The fix itself rewrites big part of unattended-upgrades-shutdown and this rewrite could cause regressions in running unattended-upgrades in InstallOnShutdown mode, but also this mode was extensively tested.  * The fix includes increasing logind's InhibitDelayMaxSec to 30s to give u-u enough time to gracefully stop in normal mode and install packages in InstallOnShutdown mode. The delay is global, thus any other program holding the lock can delay shutdown or sleep by 30s instead of the original 5s default. This regression is hard to avoid and the 30s was chosen to minimize the regression potential while still giving more than 5s to u-u to finish actions. Bugs reporting increased delay to sleep or shutdown should be monitored to catch other programs misbehaving with this new default. [Other Info] This is a regression of introduced in LP: #1778219 and can be observed in a cosmic lxd container easily: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Stopped target Local File Systems. Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: unattended-upgrades.service: Failed to reset devices.list: Operation not permitted Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Starting Unattended Upgrades Shutdown... ..
2018-11-15 16:05:04 Balint Reczey description [Impact]  * Unattended-upgrades may keep running during shutdown even beyond unmounting local filesystems potentially leaving a broken installation behind.  * The fix reverts the original fix of LP: #1778219 and applies a different one starting unattended-upgrades-shutdown _before_ the shutdown transaction starts/ [Test Case]  * Run unattended-upgrades in InstallOnShutdown mode and observe it being finished installing a few packages _before_ the shutdown transaction starts: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:50:10 cc-uu-shutdown systemd[1]: Started Unattended Upgrades Shutdown. Nov 13 12:51:17 cc-uu-shutdown systemd-logind[228]: System is rebooting. ... root@cc-uu-shutdown:~# cat /var/log/unattended-upgrades/unattended-upgrades-shutdown.log ... 2018-11-13 12:51:13,835 WARNING - Running unattended-upgrades in shutdown mode 2018-11-13 12:51:13,852 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:15,482 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,151 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,166 INFO - All upgrades installed [Regression Potential]  * The change reverts the behavior of unattended-upgrades-shutdown to be close to the behavior observed in Ubuntu 18.04, blocking the shutdown process reliably until is unattended-upgrades finished, but it starts _before_ shutdown triggered by the PrepareForShutdown() signal. Due to the shutdown not fully starting yet users may not get visual notification of unattended-upgrades running. In my testing on Bionic when a logged-in user shuts down the system when InstallOnShutdown is configured the user is dropped out to the login manager and nothing shows that u-u is running behind the screens for 30s, when the inhibition timer expires and u-u is starting to gracefully stop and the usual text appears after the login manager exits and plymouth shutdown screen is shown. The fix would be the login manager also monitoring PrepareForShutdown() and exiting. On Xenial (with Unity) starting shutdown from the graphical session does not log the user out nor show any progress on the shutdown until the inhibition timer expires which is confusing. Users should be logged out on PrepareForShutdown().  * The reversion of unattended-upgrades.service was not complete in u-u 1.7 and needed a further fix in 1.7ubuntu1 (which fix is already included in 1.5ubuntu4). This part may be source of potential regressions.  * The fix itself rewrites big part of unattended-upgrades-shutdown and this rewrite could cause regressions in running unattended-upgrades in InstallOnShutdown mode, but also this mode was extensively tested.  * The fix includes increasing logind's InhibitDelayMaxSec to 30s to give u-u enough time to gracefully stop in normal mode and install packages in InstallOnShutdown mode. The delay is global, thus any other program holding the lock can delay shutdown or sleep by 30s instead of the original 5s default. This regression is hard to avoid and the 30s was chosen to minimize the regression potential while still giving more than 5s to u-u to finish actions. Bugs reporting increased delay to sleep or shutdown should be monitored to catch other programs misbehaving with this new default. [Other Info] This is a regression of introduced in LP: #1778219 and can be observed in a cosmic lxd container easily: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Stopped target Local File Systems. Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: unattended-upgrades.service: Failed to reset devices.list: Operation not permitted Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Starting Unattended Upgrades Shutdown... .. [Impact]  * Unattended-upgrades may keep running during shutdown even beyond unmounting local filesystems potentially leaving a broken installation behind.  * The fix reverts the original fix of LP: #1778219 and applies a different one starting unattended-upgrades-shutdown _before_ the shutdown transaction starts/ [Test Case]  * Run unattended-upgrades in InstallOnShutdown mode and observe it being finished installing a few packages _before_ the shutdown transaction starts: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:50:10 cc-uu-shutdown systemd[1]: Started Unattended Upgrades Shutdown. Nov 13 12:51:17 cc-uu-shutdown systemd-logind[228]: System is rebooting. ... root@cc-uu-shutdown:~# cat /var/log/unattended-upgrades/unattended-upgrades-shutdown.log ... 2018-11-13 12:51:13,835 WARNING - Running unattended-upgrades in shutdown mode 2018-11-13 12:51:13,852 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:15,482 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,151 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,166 INFO - All upgrades installed [Regression Potential]  * The change reverts the behavior of unattended-upgrades-shutdown to be close to the behavior observed in Ubuntu 18.04, blocking the shutdown process reliably until is unattended-upgrades finished, but it starts _before_ shutdown triggered by the PrepareForShutdown() signal. Due to the shutdown not fully starting yet users may not get visual notification of unattended-upgrades running. In my testing on Bionic when a logged-in user shuts down the system when InstallOnShutdown is configured the user is dropped out to the login manager and nothing shows that u-u is running behind the screens for 30s, when the inhibition timer expires and u-u is starting to gracefully stop and the usual text appears after the login manager exits and plymouth shutdown screen is shown. The fix would be the login manager also monitoring PrepareForShutdown() and exiting (LP: #1803581). On Xenial (with Unity) starting shutdown from the graphical session does not log the user out nor show any progress on the shutdown until the inhibition timer expires which is confusing. Users should be logged out on PrepareForShutdown() (LP: #1803581).  * The reversion of unattended-upgrades.service was not complete in u-u 1.7 and needed a further fix in 1.7ubuntu1 (which fix is already included in 1.5ubuntu4). This part may be source of potential regressions.  * The fix itself rewrites big part of unattended-upgrades-shutdown and this rewrite could cause regressions in running unattended-upgrades in InstallOnShutdown mode, but also this mode was extensively tested.  * The fix includes increasing logind's InhibitDelayMaxSec to 30s to give u-u enough time to gracefully stop in normal mode and install packages in InstallOnShutdown mode. The delay is global, thus any other program holding the lock can delay shutdown or sleep by 30s instead of the original 5s default. This regression is hard to avoid and the 30s was chosen to minimize the regression potential while still giving more than 5s to u-u to finish actions. Bugs reporting increased delay to sleep or shutdown should be monitored to catch other programs misbehaving with this new default. [Other Info] This is a regression of introduced in LP: #1778219 and can be observed in a cosmic lxd container easily: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Stopped target Local File Systems. Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: unattended-upgrades.service: Failed to reset devices.list: Operation not permitted Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Starting Unattended Upgrades Shutdown... ..
2018-11-26 17:19:30 Łukasz Zemczak unattended-upgrades (Ubuntu Cosmic): status New Fix Committed
2018-11-26 17:19:31 Łukasz Zemczak bug added subscriber Ubuntu Stable Release Updates Team
2018-11-26 17:19:33 Łukasz Zemczak bug added subscriber SRU Verification
2018-11-26 17:19:35 Łukasz Zemczak tags verification-needed verification-needed-cosmic
2018-11-27 22:12:56 Balint Reczey tags verification-needed verification-needed-cosmic verification-done-cosmic verification-needed
2018-11-27 22:13:02 Balint Reczey tags verification-done-cosmic verification-needed verification-done verification-done-cosmic
2018-12-03 15:13:09 Launchpad Janitor unattended-upgrades (Ubuntu Cosmic): status Fix Committed Fix Released
2018-12-03 15:13:20 Łukasz Zemczak removed subscriber Ubuntu Stable Release Updates Team
2018-12-13 14:48:27 Balint Reczey description [Impact]  * Unattended-upgrades may keep running during shutdown even beyond unmounting local filesystems potentially leaving a broken installation behind.  * The fix reverts the original fix of LP: #1778219 and applies a different one starting unattended-upgrades-shutdown _before_ the shutdown transaction starts/ [Test Case]  * Run unattended-upgrades in InstallOnShutdown mode and observe it being finished installing a few packages _before_ the shutdown transaction starts: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:50:10 cc-uu-shutdown systemd[1]: Started Unattended Upgrades Shutdown. Nov 13 12:51:17 cc-uu-shutdown systemd-logind[228]: System is rebooting. ... root@cc-uu-shutdown:~# cat /var/log/unattended-upgrades/unattended-upgrades-shutdown.log ... 2018-11-13 12:51:13,835 WARNING - Running unattended-upgrades in shutdown mode 2018-11-13 12:51:13,852 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:15,482 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,151 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,166 INFO - All upgrades installed [Regression Potential]  * The change reverts the behavior of unattended-upgrades-shutdown to be close to the behavior observed in Ubuntu 18.04, blocking the shutdown process reliably until is unattended-upgrades finished, but it starts _before_ shutdown triggered by the PrepareForShutdown() signal. Due to the shutdown not fully starting yet users may not get visual notification of unattended-upgrades running. In my testing on Bionic when a logged-in user shuts down the system when InstallOnShutdown is configured the user is dropped out to the login manager and nothing shows that u-u is running behind the screens for 30s, when the inhibition timer expires and u-u is starting to gracefully stop and the usual text appears after the login manager exits and plymouth shutdown screen is shown. The fix would be the login manager also monitoring PrepareForShutdown() and exiting (LP: #1803581). On Xenial (with Unity) starting shutdown from the graphical session does not log the user out nor show any progress on the shutdown until the inhibition timer expires which is confusing. Users should be logged out on PrepareForShutdown() (LP: #1803581).  * The reversion of unattended-upgrades.service was not complete in u-u 1.7 and needed a further fix in 1.7ubuntu1 (which fix is already included in 1.5ubuntu4). This part may be source of potential regressions.  * The fix itself rewrites big part of unattended-upgrades-shutdown and this rewrite could cause regressions in running unattended-upgrades in InstallOnShutdown mode, but also this mode was extensively tested.  * The fix includes increasing logind's InhibitDelayMaxSec to 30s to give u-u enough time to gracefully stop in normal mode and install packages in InstallOnShutdown mode. The delay is global, thus any other program holding the lock can delay shutdown or sleep by 30s instead of the original 5s default. This regression is hard to avoid and the 30s was chosen to minimize the regression potential while still giving more than 5s to u-u to finish actions. Bugs reporting increased delay to sleep or shutdown should be monitored to catch other programs misbehaving with this new default. [Other Info] This is a regression of introduced in LP: #1778219 and can be observed in a cosmic lxd container easily: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Stopped target Local File Systems. Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: unattended-upgrades.service: Failed to reset devices.list: Operation not permitted Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Starting Unattended Upgrades Shutdown... .. [Impact]  * Unattended-upgrades may keep running during shutdown even beyond unmounting local filesystems potentially leaving a broken installation behind.  * The fix reverts the original fix of LP: #1778219 and applies a different one starting unattended-upgrades-shutdown _before_ the shutdown transaction starts/ [Test Case]  * Run unattended-upgrades in InstallOnShutdown mode and observe it being finished installing a few packages _before_ the shutdown transaction starts: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:50:10 cc-uu-shutdown systemd[1]: Started Unattended Upgrades Shutdown. Nov 13 12:51:17 cc-uu-shutdown systemd-logind[228]: System is rebooting. ... root@cc-uu-shutdown:~# cat /var/log/unattended-upgrades/unattended-upgrades-shutdown.log ... 2018-11-13 12:51:13,835 WARNING - Running unattended-upgrades in shutdown mode 2018-11-13 12:51:13,852 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:15,482 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,151 WARNING - Unattended-upgrade in progress during shutdown, please don't turn off the computer 2018-11-13 12:51:17,166 INFO - All upgrades installed [Regression Potential]  * The change reverts the behavior of unattended-upgrades-shutdown to be close to the behavior observed in Ubuntu 18.04, blocking the shutdown process reliably until is unattended-upgrades finished, but it starts _before_ shutdown triggered by the PrepareForShutdown() signal. Due to the shutdown not fully starting yet users may not get visual notification of unattended-upgrades running. In my testing on Bionic when a logged-in user shuts down the system when InstallOnShutdown is configured the user is dropped out to the login manager and nothing shows that u-u is running behind the screens for 30s, when the inhibition timer expires and u-u is starting to gracefully stop and the usual text appears after the login manager exits and plymouth shutdown screen is shown. The fix would be the login manager also monitoring PrepareForShutdown() and exiting (LP: #1803581). On Xenial (with Unity) starting shutdown from the graphical session does not log the user out nor show any progress on the shutdown until the inhibition timer expires which is confusing. Users should be logged out on PrepareForShutdown() (LP: #1803581).  * The reversion of unattended-upgrades.service was not complete in u-u 1.7 and needed a further fix in 1.7ubuntu1 (which fix is already included in 1.5ubuntu4). This part may be source of potential regressions.  * The fix itself rewrites big part of unattended-upgrades-shutdown and this rewrite could cause regressions in running unattended-upgrades in InstallOnShutdown mode, but also this mode was extensively tested.  * The fix includes increasing logind's InhibitDelayMaxSec to 30s to give u-u enough time to gracefully stop in normal mode and install packages in InstallOnShutdown mode. The delay is global, thus any other program holding the lock can delay shutdown or sleep by 30s instead of the original 5s default. This regression is hard to avoid and the 30s was chosen to minimize the regression potential while still giving more than 5s to u-u to finish actions. Bugs reporting increased delay to sleep or shutdown should be monitored to catch other programs misbehaving with this new default. * There is a rarely occurring new crash caused by this fix tracked in LP: #1806487. [Other Info] This is a regression of introduced in LP: #1778219 and can be observed in a cosmic lxd container easily: $ lxc launch ubuntu:18.10 cc-uu-onshutdown Creating cc-uu-onshutdown Starting cc-uu-onshutdown $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# apt update -qq 33 packages can be upgraded. Run 'apt list --upgradable' to see them. root@cc-uu-onshutdown:~# echo 'Unattended-Upgrade::InstallOnShutdown "true";' > /etc/apt/apt.conf.d/51unattended-upgrades-on-shutdown root@cc-uu-onshutdown:~# dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false method return time=1542112922.046290 sender=:1.4 -> destination=:1.13 serial=27 reply_serial=2 Session terminated, terminating shell...$ $ lxc shell cc-uu-onshutdown mesg: ttyname failed: No such device root@cc-uu-onshutdown:~# journalctl -l ... Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Stopped target Local File Systems. Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: unattended-upgrades.service: Failed to reset devices.list: Operation not permitted Nov 13 12:42:02 cc-uu-onshutdown systemd[1]: Starting Unattended Upgrades Shutdown... ..