ostree-prepare-root.service: add OnFailureJobMode=isolate
authorJonathan Lebon <jonathan@jlebon.com>
Thu, 21 Mar 2024 16:19:32 +0000 (12:19 -0400)
committerJonathan Lebon <jonathan@jlebon.com>
Thu, 21 Mar 2024 16:19:32 +0000 (12:19 -0400)
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

index 510d866a4cae814183a880e513290efc0b1ebd54..4c2b6babe6865fac856b6e9abac41e162eb1f28b 100644 (file)
@@ -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