Skip to content

Commit

Permalink
ostree-prepare-root.service: add OnFailureJobMode=isolate
Browse files Browse the repository at this point in the history
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. coreos/ignition-dracut@3d2e165.
  • Loading branch information
jlebon committed Mar 21, 2024
1 parent dc4d4b5 commit 05b3b66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/boot/ostree-prepare-root.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 05b3b66

Please sign in to comment.