[SRU] Allow target units to fail

Bug #1948476 reported by Alfonso Sanchez-Beato
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned

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

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :
Revision history for this message
Lukas Märdian (slyon) wrote :
Changed in systemd (Ubuntu):
status: New → Invalid
Changed in systemd (Ubuntu Focal):
status: New → In Progress
Changed in systemd (Ubuntu):
status: Invalid → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Alfonso, or anyone else affected,

Accepted systemd into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/245.4-4ubuntu3.14 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

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.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 245.4-4ubuntu3.14

---------------
systemd (245.4-4ubuntu3.14) focal; urgency=medium

  [ Lukas Märdian ]
  * Allow target units to fail (LP: #1948476)
    File: d/p/lp1948476-pid1-target-units-can-fail-through-dependencies.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=fe0cb0bd66baea89d8bbe47cb47d88540f46d470
  * Fix whitespace in lp1926547-hwdb-60-keyboard-Update-Dell-Privacy-Micmute-Hotkey-.patch to match upstream
    File: debian/patches/lp1926547-hwdb-60-keyboard-Update-Dell-Privacy-Micmute-Hotkey-.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=80fef80a1b018556939011707c4ce00cebc58806
  * Support detection for ARM64 Hyper-V guests (LP: #1952599)
    Files:
    - debian/patches/lp1952599/0001-virt-Support-detection-for-ARM64-Hyper-V-guests.patch
    - debian/patches/lp1952599/0002-virt-Fix-the-detection-for-Hyper-V-VMs.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=caf3aff933cc7bf21565faba05f78ce78b3196cd

  [ Andy Chi ]
  * Add privacy micmute hotkey for Dell machine. (LP: #1952733)
    File: debian/patches/lp1952733-hwdb-60-keyboard-Update-Dell-Privacy-Micmute-Hotkey-Map.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=ff8dc41f55baa418076e42509ddbf3212a8c1353
  * Add microphone mute key for Dell machine. (LP: #1952735)
    File: debian/patches/lp1952735-keymap-Add-microphone-mute-keymap-for-Dell-Machine.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=175fb4e209fba889b4bcd81cb2ed262923943a3f

  [ Yao Wei ]
  * Add ACCEL_LOCATION=base property for 6 Dell clamshell models (LP: #1943561)
    File: debian/patches/lp1943561-dell-clamshell-accel-location-base-with-sku.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=246195d68b2bb0473f4a3f1c2ebe54dfd37f068b

  [ Dan Streetman ]
  * d/p/lp1944711-login-filenames-in-run-systemd-users-are-uids.patch:
    Fix systemd-logind restart loading of existing sessions
    (LP: #1944711)

  [ Ratchanan Srirattanamet ]
  * d/p/debian/timedatectl-lp1650688.patch,
    d/p/debian/UBUNTU-Fix-timezone-setting-on-read-only-etc.patch:
    Fix timedated unable to retrieve & properly set timezone on
    read-only /etc (e.g. Ubuntu Core and system-image-based systems)
    (LP: #1650688)

 -- Lukas Märdian <email address hidden> Fri, 10 Dec 2021 10:04:02 +0100

Changed in systemd (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.