This is caused by a missing "Default-Start" header in /etc/init.d/unattended-upgrades. Trying to enable the unit leads to :
# systemctl enable unattended-upgrades.service
Synchronizing state of unattended-upgrades.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable unattended-upgrades
update-rc.d: error: unattended-upgrades Default-Start contains no runlevels, aborting.
I'm currently working on fixing all this in the packaging so we get a correctly working unit after the upgrade of the package.
With this configuration, the unit runs the ExecStop as expected. I also tested using Unattended-Upgrade::InstallOnShutdown "true" and it works as expected, which is to block the shutdown for upgrade with the network being available.
I should have that available for testing tomorrow.
Here is a recap of my day of work :
The unattended- upgrades. service unit never runs the ExecStop because it is not enabled as we see here :
# systemctl status unattended- upgrades. service upgrades. service - Unattended Upgrades Shutdown system/ unattended- upgrades. service; enabled; vendor preset: enabled) upgrade( 8)
● unattended-
Loaded: loaded (/lib/systemd/
Active: inactive (dead) <<<<<<<<<<<<<<<
Docs: man:unattended-
This is caused by a missing "Default-Start" header in /etc/init. d/unattended- upgrades. Trying to enable the unit leads to :
# systemctl enable unattended- upgrades. service upgrades. service with SysV init with /lib/systemd/ systemd- sysv-install. .. systemd- sysv-install enable unattended-upgrades
Synchronizing state of unattended-
Executing /lib/systemd/
update-rc.d: error: unattended-upgrades Default-Start contains no runlevels, aborting.
I'm currently working on fixing all this in the packaging so we get a correctly working unit after the upgrade of the package.
I have also reworked the unit :
[Unit] Unattended Upgrades Shutdown cies=no target local-fs.target or=/var/ log /var/run man:unattended- upgrade( 8)
Description=
DefaultDependen
After=network.
RequiresMountsF
Documentation=
[Service] /usr/share/ unattended- upgrades/ unattended- upgrade- shutdown
Type=oneshot
RemainAfterExit=yes
ExecStop=
TimeoutStopSec=900
[Install] multi-user. target
WantedBy=
With this configuration, the unit runs the ExecStop as expected. I also tested using Unattended- Upgrade: :InstallOnShutd own "true" and it works as expected, which is to block the shutdown for upgrade with the network being available.
I should have that available for testing tomorrow.