From 05b3b662756def30026fc722d0832a24a33d9803 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Thu, 21 Mar 2024 12:19:32 -0400 Subject: [PATCH] ostree-prepare-root.service: add OnFailureJobMode=isolate This is stronger than the default (`replace`) because it tells systemd to *stop everything* and go to `emergency.target`. In other codebases, this has definitely helped me with the problem of "systemd keeps going even after a failure". Likely addresses #3219. See also e.g. https://github.com/coreos/ignition-dracut/commit/3d2e165f97f30c1e62577357f27f32e60e6add18. --- src/boot/ostree-prepare-root.service | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/boot/ostree-prepare-root.service b/src/boot/ostree-prepare-root.service index 510d866a4c..4c2b6babe6 100644 --- a/src/boot/ostree-prepare-root.service +++ b/src/boot/ostree-prepare-root.service @@ -19,11 +19,13 @@ Documentation=man:ostree(1) DefaultDependencies=no ConditionKernelCommandLine=ostree ConditionPathExists=/etc/initrd-release -OnFailure=emergency.target After=sysroot.mount Requires=sysroot.mount Before=initrd-root-fs.target +OnFailure=emergency.target +OnFailureJobMode=isolate + [Service] Type=oneshot ExecStart=/usr/lib/ostree/ostree-prepare-root /sysroot