[Xenial/0.90] Systemd dependencies issues when used in "Shutdown mode"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unattended-upgrades (Ubuntu) |
Fix Released
|
Medium
|
Brian Murray | ||
Xenial |
Fix Released
|
Medium
|
Brian Murray | ||
Yakkety |
Fix Released
|
Medium
|
Brian Murray |
Bug Description
[Impact]
There are some race conditions in unattended-upgrades when it is used in shutdown mode. It is possible that the network has already been brought down or for a local file system, like /var/, to be unmounted before the unattended-upgrades script is run. This then causes the updates not to be installed thereby making systems less secure - if security updates are enabled.
[Test Case]
Because this is a race condition, I haven't actually been able to recreate the bug. However, the fix is straightforward and testing for regressions should be sufficient.
1) On a freshly installed system.
2) Modify /etc/apt/
Unattended-
3) Reboot and watch updates being installed
4) Verify updates were installed by reviewing /var/log/
5) Uncomment -updates in 50unattended-
Repeats steps 3 and 4 again. There isn't any need to run unattended-upgrades in *not* shutdown mode because we have only modified the systemd service file.
[Regression Potential]
There is little chance of a regression, but because of the change (and this feature now working better) its possible the shutdown process will take longer and surprise users.
Original Description
-------
Using unattended-upgrades 0.90 in "Shutdown mode" on Ubuntu Xenial, we encounter the following systemd dependencies issues :
- The network is often down when unattended-upgrades is running, so packages can not be downloaded (can be mitigated by using APT::Periodic:
=> ERROR An error occurred: 'Could not resolve host: ****.fr'
=> ERROR The URI 'https:/
- Important mountpoints like /boot are unmounted before unattended-upgrades is running, so newer kernels can not be installed properly (ramdisk and grub configuration can not be generated)
tags: | added: xenial |
Changed in unattended-upgrades (Ubuntu): | |
status: | Confirmed → Triaged |
Changed in unattended-upgrades (Ubuntu): | |
assignee: | nobody → Brian Murray (brian-murray) |
Changed in unattended-upgrades (Ubuntu): | |
milestone: | none → ubuntu-17.02 |
Changed in unattended-upgrades (Ubuntu Xenial): | |
assignee: | nobody → Brian Murray (brian-murray) |
Changed in unattended-upgrades (Ubuntu Yakkety): | |
milestone: | none → yakkety-updates |
description: | updated |
Changed in unattended-upgrades (Ubuntu Xenial): | |
status: | Triaged → In Progress |
Changed in unattended-upgrades (Ubuntu Yakkety): | |
status: | Triaged → In Progress |
assignee: | nobody → Brian Murray (brian-murray) |
The service possibly needs a relationship with the network service.
[Unit] Unattended Upgrades Shutdown cies=no shutdown. target reboot.target halt.target man:unattended- upgrade( 8)
Description=
DefaultDependen
Before=
Documentation=
[Service] /usr/share/ unattended- upgrades/ unattended- upgrade- shutdown
Type=oneshot
ExecStart=
TimeoutStartSec=900
[Install] shutdown. target
WantedBy=