Systemd update installation hangs in unattended-upgrades InstallOnShutdown mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Xenial |
Fix Released
|
High
|
Unassigned | ||
Bionic |
Fix Released
|
High
|
Unassigned | ||
Cosmic |
Fix Released
|
High
|
Unassigned | ||
Disco |
Fix Released
|
High
|
Unassigned |
Bug Description
[Impact]
* Installation of latest systemd update in -security hangs with current versions of unattended-upgrades in supported releases. The u-u-side fix is tracked in LP: #1778219.
[Regression Potential]
* The daemons, shipped in deb:systemd, are not attempted to be restarted because despite package installation the system is in the middle of shutting down. This means that currently running daemons may be helding up open files on the filesystem, however all process are being stopped and killed as part of shutdown. Hence the worst possible regression from this, is an unclean shutdown, but even that shouldn't happen with this update.
[Test Case]
Reproduction:
rbalint@yogi:~$ lxc launch ubuntu:18.04 uu-systemd-
Creating uu-systemd-
Starting uu-systemd-
rbalint@yogi:~$ lxc shell uu-systemd-
mesg: ttyname failed: No such device
root@uu-
23 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@uu-
root@uu-
Listing... Done
apport/
gettext-
kmod/bionic-updates 24-1ubuntu3.1 amd64 [upgradable from: 24-1ubuntu3]
libglib2.
libglib2.
libkmod2/
libmspack0/
libnss-
libpam-
libsystemd0/
libudev1/
lxd/bionic-updates 3.0.2-0ubuntu1~
lxd-client/
openssh-
openssh-
openssh-
python3-
python3-
python3-
systemd/
systemd-
ubuntu-
udev/bionic-
root@uu-
Session terminated, terminating shell...Terminated
root@uu-systemd-
rbalint@yogi:~$
rbalint@yogi:~$ lxc shell uu-systemd-
mesg: ttyname failed: No such device
root@uu-
Preparing to unpack .../libsystemd0
Unpacking libsystemd0:amd64 (237-3ubuntu10.6) over (237-3ubuntu10.3) ...
Setting up libsystemd0:amd64 (237-3ubuntu10.6) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up systemd (237-3ubuntu10.6) ...
Failed to try-restart systemd-
See system logs and 'systemctl status systemd-
Failed to try-restart systemd-
See system logs and 'systemctl status systemd-
root@uu-
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 15:34 ? 00:00:00 /lib/systemd/
root 53 1 0 15:34 ? 00:00:00 /lib/systemd/
systemd+ 153 1 0 15:34 ? 00:00:00 /lib/systemd/
systemd+ 154 1 0 15:34 ? 00:00:00 /lib/systemd/
message+ 194 1 0 15:34 ? 00:00:00 /usr/bin/
root 572 1 0 15:35 ? 00:00:00 /usr/bin/python3 /usr/share/
root 586 572 0 15:35 ? 00:00:08 /usr/bin/python3 /usr/bin/
root 829 0 0 15:35 ? 00:00:00 su -l
root 830 829 0 15:35 ? 00:00:00 -su
root 1244 1 0 15:35 ? 00:00:00 /lib/systemd/
root 1918 1 0 15:35 ? 00:00:00 /usr/sbin/sshd -D
root 1952 586 0 15:35 ? 00:00:00 /usr/bin/python3 /usr/bin/
root 2111 1952 0 15:35 pts/0 00:00:00 /usr/bin/dpkg --status-fd 10 --configure --pending
root 2125 2111 0 15:35 pts/0 00:00:00 /bin/sh /var/lib/
root 2165 2125 0 15:35 pts/0 00:00:00 systemctl try-restart systemd-
root 2170 0 0 15:36 ? 00:00:00 su -l
root 2171 2170 0 15:36 ? 00:00:00 -su
root 2197 2171 0 15:36 ? 00:00:00 ps -ef
root 2198 2171 0 15:36 ? 00:00:00 cat
root@uu-
JOB UNIT TYPE STATE
323 reboot.target start waiting
405 basic.target stop waiting
359 sysinit.target stop waiting
433 cloud-init.service stop waiting
422 user.slice stop waiting
388 snapd.socket stop waiting
428 swap.target stop waiting
332 shutdown.target start waiting
412 slices.target stop waiting
415 systemd-
338 syslog.socket stop waiting
399 acpid.socket stop waiting
377 uuidd.socket stop waiting
416 systemd-
373 acpid.path stop waiting
432 local-fs.target stop waiting
437 cryptsetup.target stop waiting
341 lxd.socket stop waiting
491 systemd-
340 sockets.target stop waiting
330 var-lib-lxcfs.mount stop waiting
430 cloud-init-
453 paths.target stop waiting
402 iscsid.socket stop waiting
439 local-fs-pre.target stop waiting
392 dbus.socket stop waiting
440 systemd-
353 systemd-
324 systemd-
498 systemd-
325 final.target start waiting
414 systemd-
331 run-user-0.mount stop waiting
435 network.target stop waiting
457 systemd-
458 systemd-
329 umount.target start waiting
369 unattended-
434 network-pre.target stop waiting
436 systemd-
456 systemd-
389 apport-
497 systemd-
43 jobs listed.
root@uu-
CVE References
tags: | added: patch |
information type: | Public → Public Security |
description: | updated |
Changed in systemd (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in systemd (Ubuntu Xenial): | |
importance: | Undecided → High |
Changed in systemd (Ubuntu Bionic): | |
importance: | Undecided → High |
Changed in systemd (Ubuntu Cosmic): | |
importance: | Undecided → High |
that's really really really bad!
_systemctl try-restart systemd- journald. service || true
_must_ not hang, it should either succeed or fail. that is the whole point of try-restart....
I wonder if `--no-block` would help here, but that's also a bandaid. Imho systemctl/systemd itself shouldn't be able to hang systems like that and like should reject this job submission if it will be impossible to complete.