[Bug 1948476] Re: [SRU] Allow target units to fail
Alfonso Sanchez-Beato
1948476 at bugs.launchpad.net
Mon Dec 13 16:07:11 UTC 2021
This fixes https://github.com/snapcore/core-initrd/issues/33. Tested by
building a core20 snap from focal proposed.
Before:
[ 6.611137] systemd[1]: systemd 245.4-4ubuntu3.13 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
[ 6.628034] systemd[1]: Detected virtualization kvm.
[ 6.629644] systemd[1]: Detected architecture x86-64.
[ 6.706930] systemd[1]: Set hostname to <ubuntu>.
[ 7.212069] systemd[1]: emergency.target: Requested dependency OnFailure=reboot.target ignored (target units cannot fail).
[ 7.499630] systemd[1]: Unnecessary job for /dev/vda4 was removed.
With the change:
[ 6.160462] systemd[1]: systemd 245.4-4ubuntu3.14 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
[ 6.164774] systemd[1]: Detected virtualization kvm.
[ 6.165851] systemd[1]: Detected architecture x86-64.
[ 6.176059] systemd[1]: Set hostname to <ubuntu>.
[ 6.521391] systemd[1]: Unnecessary job for /dev/vda4 was removed.
** Bug watch added: github.com/snapcore/core-initrd/issues #33
https://github.com/snapcore/core-initrd/issues/33
** Tags removed: verification-needed verification-needed-focal
** Tags added: verification-done verification-done-focal
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1948476
Title:
[SRU] Allow target units to fail
Status in systemd package in Ubuntu:
Fix Released
Status in systemd source package in Focal:
Fix Committed
Bug description:
[Impact]
A systemd regression in focal made it think that target units cannot
fail, which produced warnings like:
emergency.target: Requested dependency OnFailure=reboot.target ignored
(target units cannot fail).
So the OnFailure settings are ignored for targets (see
https://github.com/snapcore/core-initrd/issues/33 for details).
Upstream fixed the issue in v246:
https://github.com/systemd/systemd/commit/94d1ddbd7cd15b1073757eb5ae0645c83f0b414c
[Test Plan]
Test on a UC system and check that the above warnings are not shown
anymore. Check that when a target service type fails, the OnFailure
setting is used and the mentioned service is run.
[Where problems could occur]
Issues might happen if some target has an OnFailure setting that was
never run in the past because of this bug, and the behavior is not
really right because it was never tested. However, OnFailure is not
used that much on 20.04 in target services:
/lib/systemd $ find . -name \*.target | xargs grep OnFailure
/lib/systemd $
/etc/systemd $ find . -name \*.target | xargs grep OnFailure
/etc/systemd $
I've seen it only in emergency.target for UC20.
[Other Info]
None
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1948476/+subscriptions
More information about the foundations-bugs
mailing list