I just confirmed that InstallOnShutdown does work, it is triggered by
PrepareForShutdown(), not the TERM signal:

balint@yogi:~$ lxc launch ubuntu:cosmic cc-lp-1806463
Creating cc-lp-1806463
Starting cc-lp-1806463
rbalint@yogi:~$ lxc shell cc-lp-1806463
root@cc-lp-1806463:~# apt update
...
root@cc-lp-1806463:~# apt install unattended-upgrades 
...
root@cc-lp-1806463:~# reboot
...
# enable InstallOnShutdown:
root@cc-lp-1806463:~# vi /etc/apt/apt.conf.d/50unattended-upgrades 

root@cc-lp-1806463:~# dbus-send --system --print-reply 
--dest=org.freedesktop.login1 /org/freedesktop/login1 
"org.freedesktop.login1.Manager.Reboot" boolean:false
method return time=1543938923.733435 sender=:1.2 -> destination=:1.14 serial=32 
reply_serial=2
root@cc-lp-1806463:~# top
...
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND    
                                                                                
                                                                        
  547 root      20   0  257324  86180  49460 S   1.0   0.5   0:02.81 
unattended-upgr                                                                 
                                                                                
   
  567 root      20   0  258132  73168  36236 S   0.0   0.5   0:00.08 
unattended-upgr                                                                 
                                                                                
   
  237 root      20   0  627388  30768  16548 S   0.0   0.2   0:00.34 snapd      
                                                                                
                                                                        
  233 root      20   0  125852  21016  12980 S   0.0   0.1   0:00.09 
unattended-upgr                                                                 
                                                                                
   
  229 root      20   0   47400  17436   9696 S   0.0   0.1   0:00.09 
networkd-dispat                                                                 
                                                                                
   
  578 root      20   0   18760  11192   2748 D  19.0   0.1   0:00.34 dpkg       
                                                                                
                                                                        
...

root@cc-lp-1806463:~# 
Session terminated, terminating shell...logout
 ...terminated.
rbalint@yogi:~$ lxc shell cc-lp-1806463
mesg: ttyname failed: No such device
root@cc-lp-1806463:~# cat /var/log/unattended-upgrades/unattended-upgrades
unattended-upgrades-dpkg.log      unattended-upgrades-shutdown.log  
unattended-upgrades.log           
root@cc-lp-1806463:~# cat 
/var/log/unattended-upgrades/unattended-upgrades-shutdown.log 
2018-12-04 15:54:11,587 WARNING - SIGTERM or SIGHUP received, stopping 
unattended-upgradesonly if it is running
2018-12-04 15:55:23,748 WARNING - Running unattended-upgrades in shutdown mode
2018-12-04 15:55:23,765 WARNING - Unattended-upgrade in progress during 
shutdown, please don't turn off the computer
Progress: 0.0025 % (perl-base,perl-modules-5.26,libperl5.26,perl)
2018-12-04 15:55:26,737 WARNING - Unattended-upgrade in progress during 
shutdown, please don't turn off the computer
Progress: 0.0 % (perl-modules-5.26)
2018-12-04 15:55:29,740 WARNING - Unattended-upgrade in progress during 
shutdown, please don't turn off the computer
Progress: 20.0 % (perl-modules-5.26)
2018-12-04 15:55:32,742 WARNING - Unattended-upgrade in progress during 
shutdown, please don't turn off the computer
Progress: 80.0 % (perl-modules-5.26)
2018-12-04 15:55:35,746 WARNING - Unattended-upgrade in progress during 
shutdown, please don't turn off the computer
Progress: 46.1538 % (perl)
2018-12-04 15:55:38,747 WARNING - Unattended-upgrade in progress during 
shutdown, please don't turn off the computer
Progress: 92.3077 % (perl)
2018-12-04 15:55:41,752 WARNING - Unattended-upgrade in progress during 
shutdown, please don't turn off the computer
Progress: 92.3077 % (perl)
2018-12-04 15:55:41,769 INFO - All upgrades installed


For more details please see the 
/usr/share/doc/unattended-upgrades/NEWS.Debian.gz, the changelog, and LP: 
#1803137.

** Changed in: unattended-upgrades (Ubuntu)
       Status: New => Incomplete

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

Title:
  Unattended-Upgrade::InstallOnShutdown "true" not working

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1806463/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to