severity 809669 critical
tags 809669 + patch
--

Hi,

I bumped the severity of this bug because I have seen it cause at least
three systems to hang (possibly until the Unattended Upgrades Shutdown
job times out - I've never waited that long) on every single
shutdown/reboot. This makes some systems which reboot often almost
unusable.

The hang is apparently because /var is unmounted before
unattended-upgrade-shutdown runs, which causes it to falsely believe
that there's an unattended-upgrade running.

In any case, it causes restart/shutdown to hang every time with the only
way to get anything to happen in a timely manner to cut the power or
Alt-SysRq-b.

The problem is caused by an incorrect unattended-upgrades.service file.
According to upstream[0] rather than targeting shutodwn.target, the
correct way to order jobs on shutdown is to use an empty ExecStart
with the desired command in ExecStop. I've tested the following
/etc/systemd/system/unattended-upgrades.service file and it fixes the
problem for me:

  [Unit]
  Description=Unattended Upgrades Shutdown
  After=network.target
  Documentation=man:unattended-upgrade(8)
  
  [Service]
  Type=oneshot
  RemainAfterExit=yes
  ExecStop=/usr/share/unattended-upgrades/unattended-upgrade-shutdown
  TimeoutStopSec=900
  
  [Install]
  WantedBy=multi-user.target


[0]
https://lists.freedesktop.org/archives/systemd-devel/2014-October/023860.html

-- 
Regards,
Scott.

Attachment: signature.asc
Description: PGP signature

Reply via email to