It doesn't relate to "/usr/share/unattended-upgrades/unattended-upgrade- shutdown" file at all. When you "fix" it - it just fails because of the invalid python syntax. And shutdown just works.
The real problem is systemd dependencies. Here is the log of the shutdown process: Unattended upgrades should be started before filesystem unmount, but it starts after unmount: [ OK ] Unmounted /home. [ OK ] Stopped File System Check on /dev/mapper/VG-home. [ OK ] Unmounted /var. [ OK ] Stopped File System Check on /dev/mapper/VG-var. [ OK ] Unmounted /boot. [ OK ] Stopped File System Check on /dev/mapper/VG-boot. [ OK ] Removed slice system-systemd\x2dfsck.slice. [ OK ] Stopped Login to default iSCSI targets. Stopping iSCSI initiator daemon (iscsid)... [ OK ] Stopped iSCSI initiator daemon (iscsid). [ OK ] Stopped target Network is Online. [ OK ] Stopped target Network. [ OK ] Stopped Initial cloud-init job (metadata service crawler). Stopping Raise network interfaces... [ OK ] Stopped Raise network interfaces. [ OK ] Stopped target Local File Systems. Unmounting /run/user/1000... Starting Unattended Upgrades Shutdown... [ OK ] Stopped Apply Kernel Variables. [ OK ] Stopped target Network (Pre). [ OK ] Stopped Initial cloud-init job (pre-networking). [ OK ] Stopped Load Kernel Modules. [ OK ] Unmounted /run/user/1000. [ OK ] Reached target Unmount All Filesystems. [ OK ] Stopped target Local File Systems (Pre). [ OK ] Stopped Create Static Device Nodes in /dev. Stopping Monitoring of LVM2 mirrors... dmeventd or progress polling... [ OK ] Stopped Remount Root and Kernel File Systems. [ OK ] Stopped Monitoring of LVM2 mirrors,...ng dmeventd or progress polling. Stopping LVM2 metadata daemon... [ OK ] Stopped LVM2 metadata daemon. And it is reproducible with LVM only. Have to spend some time on investigation. -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to unattended-upgrades in Ubuntu. https://bugs.launchpad.net/bugs/1661611 Title: apt/unattended-upgrades stalls shutdown Status in unattended-upgrades package in Ubuntu: Confirmed Bug description: When unattended-upgrades is installed, 9 out of 10 shutdowns/reboots hang while "starting unattended upgrades shutdown". This hang stalls the shutdown process for 5-10 mins. If I disable unnattended-upgrades via the /etc/apt/apt.conf.d/20auto- upgrades and/or 50unattended-upgrades, the problems occurs. If I terminate the service before shutdown/reboot (sudo service unattended-upgrades stop) the problem still occurs. If I remove the package (sudo apt remove unattended-upgrades) the problem no longer occurs. This occurs on a freshly installed version of Ubuntu Server 16.04.1 (both unattended-upgrades installed via install GUI or manual install of unattended-upgrades) Both Kern.log & syslog do not show the shutdown process (I believe because the filesystems have already unmounted) Original report: http://askubuntu.com/questions/878630/apt-unattended- upgrades-stalls-shutdown To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1661611/+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