Tested 1.1ubuntu1.18.04.7~16.04.2 on Xenial:

root@x-uu-lp-1690980:~# tail -f 
/var/log/unattended-upgrades/unattended-upgrades.log 
2019-04-09 13:08:24,515 INFO Initial blacklisted packages: 
2019-04-09 13:08:24,516 INFO Initial whitelisted packages: 
2019-04-09 13:08:24,516 INFO Starting unattended upgrades script
2019-04-09 13:08:24,516 INFO Allowed origins are: ['o=Ubuntu,a=xenial', 
'o=Ubuntu,a=xenial-security', 'o=UbuntuESM,a=xenial', 
'o=Ubuntu,a=xenial-updates']
2019-04-09 15:01:44,987 INFO Initial blacklisted packages: 
2019-04-09 15:01:44,988 INFO Initial whitelisted packages: 
2019-04-09 15:01:44,988 INFO Starting unattended upgrades script
2019-04-09 15:01:44,988 INFO Allowed origins are: o=Ubuntu,a=xenial, 
o=Ubuntu,a=xenial-security, o=UbuntuESM,a=xenial, o=Ubuntu,a=xenial-updates
2019-04-09 15:02:06,773 INFO Packages that will be upgraded: adwaita-icon-theme 
dirmngr fontconfig fontconfig-config gir1.2-gdkpixbuf-2.0 gir1.2-gtk-3.0 
glib-networking glib-networking-common glib-networking-services gnupg-agent 
gnupg2 gstreamer1.0-plugins-base gstreamer1.0-plugins-good 
gstreamer1.0-pulseaudio gstreamer1.0-x hicolor-icon-theme humanity-icon-theme 
hwdata libarchive13 libavahi-client3 libavahi-common-data libavahi-common3 
libboost-filesystem1.58.0 libboost-iostreams1.58.0 libboost-system1.58.0 
libcaca0 libcups2 libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 
libegl1-mesa libepoxy0 libexempi3 libfontconfig1 libgbm1 libgd3 
libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgl1-mesa-dri libgl1-mesa-glx 
libglapi-mesa libgraphite2-3 libgstreamer-plugins-base1.0-0 
libgstreamer-plugins-good1.0-0 libgstreamer1.0-0 libgtk-3-0 libgtk-3-bin 
libgtk-3-common libharfbuzz0b libinput10 libjpeg-turbo8 libksba8 liblcms2-2 
libllvm3.8 libmirclient9 libmirprotobuf3 libnautilus-extension1a libnspr4 
libnss3 libnss3-nssdb libpam-systemd libpulse0 libsane libsane-common 
libsndfile1 libsoup-gnome2.4-1 libsoup2.4-1 libsystemd0 libtiff5 
libtracker-sparql-1.0-0 libudev1 libvorbis0a libvorbisenc2 libwacom-bin 
libwacom-common libwacom2 libwavpack1 libwayland-client0 libwayland-cursor0 
libwayland-egl1-mesa libwayland-server0 libx11-xcb1 libxcursor1 libxkbcommon0 
libxpm4 systemd systemd-sysv ubuntu-mono udev wget x11-common
2019-04-09 15:02:06,774 INFO Writing dpkg log to 
/var/log/unattended-upgrades/unattended-upgrades-dpkg.log
^C
root@x-uu-lp-1690980:~# dbus-send --system --print-reply 
--dest=org.freedesktop.login1 /org/freedesktop/login1 
"org.freedesktop.login1.Manager.Reboot" boolean:false
method return time=1554822131.758122 sender=:1.1 -> destination=:1.7 serial=33 
reply_serial=2
root@x-uu-lp-1690980:~# 
root@x-uu-lp-1690980:~# tail -f 
/var/log/unattended-upgrades/unattended-upgrades.log 
2019-04-09 13:08:24,516 INFO Allowed origins are: ['o=Ubuntu,a=xenial', 
'o=Ubuntu,a=xenial-security', 'o=UbuntuESM,a=xenial', 
'o=Ubuntu,a=xenial-updates']
2019-04-09 15:01:44,987 INFO Initial blacklisted packages: 
2019-04-09 15:01:44,988 INFO Initial whitelisted packages: 
2019-04-09 15:01:44,988 INFO Starting unattended upgrades script
2019-04-09 15:01:44,988 INFO Allowed origins are: o=Ubuntu,a=xenial, 
o=Ubuntu,a=xenial-security, o=UbuntuESM,a=xenial, o=Ubuntu,a=xenial-updates
2019-04-09 15:02:06,773 INFO Packages that will be upgraded: adwaita-icon-theme 
dirmngr fontconfig fontconfig-config gir1.2-gdkpixbuf-2.0 gir1.2-gtk-3.0 
glib-networking glib-networking-common glib-networking-services gnupg-agent 
gnupg2 gstreamer1.0-plugins-base gstreamer1.0-plugins-good 
gstreamer1.0-pulseaudio gstreamer1.0-x hicolor-icon-theme humanity-icon-theme 
hwdata libarchive13 libavahi-client3 libavahi-common-data libavahi-common3 
libboost-filesystem1.58.0 libboost-iostreams1.58.0 libboost-system1.58.0 
libcaca0 libcups2 libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 
libegl1-mesa libepoxy0 libexempi3 libfontconfig1 libgbm1 libgd3 
libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgl1-mesa-dri libgl1-mesa-glx 
libglapi-mesa libgraphite2-3 libgstreamer-plugins-base1.0-0 
libgstreamer-plugins-good1.0-0 libgstreamer1.0-0 libgtk-3-0 libgtk-3-bin 
libgtk-3-common libharfbuzz0b libinput10 libjpeg-turbo8 libksba8 liblcms2-2 
libllvm3.8 libmirclient9 libmirprotobuf3 libnautilus-extension1a libnspr4 
libnss3 libnss3-nssdb libpam-systemd libpulse0 libsane libsane-common 
libsndfile1 libsoup-gnome2.4-1 libsoup2.4-1 libsystemd0 libtiff5 
libtracker-sparql-1.0-0 libudev1 libvorbis0a libvorbisenc2 libwacom-bin 
libwacom-common libwacom2 libwavpack1 libwayland-client0 libwayland-cursor0 
libwayland-egl1-mesa libwayland-server0 libx11-xcb1 libxcursor1 libxkbcommon0 
libxpm4 systemd systemd-sysv ubuntu-mono udev wget x11-common
2019-04-09 15:02:06,774 INFO Writing dpkg log to 
/var/log/unattended-upgrades/unattended-upgrades-dpkg.log
2019-04-09 15:02:11,761 WARNING SIGTERM received, will stop
2019-04-09 15:02:14,904 WARNING SIGTERM received, will stop
2019-04-09 15:02:17,763 WARNING SIGTERM received, will stop
2019-04-09 15:02:20,896 WARNING SIGTERM received, will stop
2019-04-09 15:02:23,877 WARNING SIGTERM received, will stop
2019-04-09 15:02:26,774 WARNING SIGTERM received, will stop
2019-04-09 15:02:29,907 WARNING SIGTERM received, will stop
2019-04-09 15:02:29,908 WARNING SIGNAL received, stopping

^C

... and the lxc container restarted nicely.

After logging in u-u can continue:

root@x-uu-lp-1690980:~# unattended-upgrade --verbose
Initial blacklisted packages: 
Initial whitelisted packages: 
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=xenial, o=Ubuntu,a=xenial-security, 
o=UbuntuESM,a=xenial, o=Ubuntu,a=xenial-updates
Packages that will be upgraded: adwaita-icon-theme dirmngr fontconfig 
fontconfig-config gir1.2-gdkpixbuf-2.0 gir1.2-gtk-3.0 glib-networking 
glib-networking-common glib-networking-services gnupg-agent gnupg2 
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-pulseaudio 
gstreamer1.0-x hicolor-icon-theme humanity-icon-theme hwdata libarchive13 
libavahi-client3 libavahi-common-data libavahi-common3 
libboost-filesystem1.58.0 libboost-iostreams1.58.0 libboost-system1.58.0 
libcaca0 libcups2 libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 
libegl1-mesa libepoxy0 libexempi3 libfontconfig1 libgbm1 libgd3 
libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgl1-mesa-dri libgl1-mesa-glx 
libglapi-mesa libgraphite2-3 libgstreamer-plugins-base1.0-0 
libgstreamer-plugins-good1.0-0 libgstreamer1.0-0 libgtk-3-0 libgtk-3-bin 
libgtk-3-common libharfbuzz0b libinput10 libjpeg-turbo8 libksba8 liblcms2-2 
libllvm3.8 libmirclient9 libmirprotobuf3 libnautilus-extension1a libnspr4 
libnss3 libnss3-nssdb libpam-systemd libpulse0 libsane libsane-common 
libsndfile1 libsoup-gnome2.4-1 libsoup2.4-1 libsystemd0 libtiff5 
libtracker-sparql-1.0-0 libudev1 libvorbis0a libvorbisenc2 libwacom-bin 
libwacom-common libwacom2 libwavpack1 libwayland-client0 libwayland-cursor0 
libwayland-egl1-mesa libwayland-server0 libx11-xcb1 libxcursor1 libxkbcommon0 
libxpm4 systemd systemd-sysv ubuntu-mono udev wget x11-common
Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
(Reading database ... 42805 files and directories currently installed.)
Preparing to unpack .../gir1.2-gdkpixbuf-2.0_2.32.2-1ubuntu1.6_amd64.deb ...
Unpacking gir1.2-gdkpixbuf-2.0:amd64 (2.32.2-1ubuntu1.6) over (2.32.2-1ubuntu1) 
...
Setting up gir1.2-gdkpixbuf-2.0:amd64 (2.32.2-1ubuntu1.6) ...
Log ended: 2019-04-09  15:07:10
...

** Tags removed: verification-needed verification-needed-xenial
** Tags added: verification-done verification-done-xenial

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/1690980

Title:
  unattended-upgrades does not block shutdown of system, as it is
  designed to

Status in OEM Priority Project:
  Triaged
Status in OEM Priority Project xenial series:
  Triaged
Status in apt package in Ubuntu:
  Fix Released
Status in unattended-upgrades package in Ubuntu:
  Fix Released
Status in apt source package in Xenial:
  Fix Released
Status in unattended-upgrades source package in Xenial:
  Fix Committed
Status in apt source package in Zesty:
  Won't Fix
Status in unattended-upgrades source package in Zesty:
  Won't Fix

Bug description:
  Title: No pop-up window to warn users that system should not reboot or
  shutdown while installing security updates

  Summary:
  No pop-up window to warn users that system should not reboot or shutdown 
while installing security updates

  Steps:
  1. trigger unattended-upgrades
  2. reboot or shutdown system while installing packages

  Expected results: There is a pop-up window to warn users that system
  should not reboot or shutdown

  Actual results: There is no pop-up window to warn users

  Additional information:
  $ apt-cache policy unattended-upgrades
  unattended-upgrades:
    Installed: 0.90
    Candidate: 0.90ubuntu0.5
  $ lsb_release -rd
  Description:    Ubuntu 16.04 LTS

  * APT SRU *
  [Impact]
  Stopping apt-daily-upgrade.service terminates dpkg and friends by sending the 
signals to all processes in the cgroup, and will send KILL quickly after.

  [Test case]
  Start apt-daily-upgrade.service and stop it while unattended-upgrades is 
running.

  The upgrade should run to completion or a safe exit point as long as
  it takes less than about 900s (which is the timeout for sending kill).

  [Regression potential]
  Leftover processes might remain in the apt-daily-upgrade cgroup if the 
postinst scripts or some apt hooks do something funny.

  Shutdown might take longer due to the 900 second timeout.

  * unattended-upgrades SRU

  [Impact]

   * Undattended-upgrades does not stop quickly gracefully when shutdown/reboot 
is initiated by the user.
   * The fix is performing the updates in minimal package sets and allow 
gracefully stopping between those steps when unattended-upgrades.service sends 
a TERM signal to running u-u. The signal is sent on receiving 
PrepareForShutdown() from logind 
(https://www.freedesktop.org/wiki/Software/systemd/inhibit/) to stop 
unattended-upgrades a bit earlier than the shutdown process starts (LP: 
#1803137).

  [Test Case]

  * Configure the system to have several 20+ packages upgradable by
  unattended-upgrades. One easy way of setting this up is starting with
  a system where packages from -security are installed but packages from
  -updates are not and enabling -updates in u-u:

    # echo 'Unattended-Upgrade::Allowed-Origins::
  "${distro_id}:${distro_codename}-updates";' > /etc/apt/apt.conf.d
  /51unattended-upgrades-updates-too

  * Pre-download upgrades
    # unattended-upgraded --download-only

  * Trigger unattended-upgrades run:
    # service apt-daily-upgrade start

  * Shutdown the system from a graphical user session or by executing
    # dbus-send --system --print-reply --dest=org.freedesktop.login1 
/org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:false

   * Observe the system unattended-upgrades being gracefully stopped,
  checking /var/log/unattended-upgrades/unattended-upgrades.log. There
  should be packages left to be upgraded.

  [Regression Potential]

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/1690980/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to