Skip to content

overlay: Bind ostree-prepare-root.service to ignition-complete.target#207

Closed
cgwalters wants to merge 1 commit intocoreos:testing-develfrom
cgwalters:ignition-bind-prepare-root
Closed

overlay: Bind ostree-prepare-root.service to ignition-complete.target#207
cgwalters wants to merge 1 commit intocoreos:testing-develfrom
cgwalters:ignition-bind-prepare-root

Conversation

@cgwalters
Copy link
Member

This unit comes from ostree upstream, but forms part of our
Ignition sequence. Make it required by ignition-complete.target
so that if it fails we get the same OnFailure= behavior.

Making this change as during development ignition-ostree-mount-sysroot.service
wasn't running which caused this unit to fail; the root cause would have been
a bit more obvious with this change.

This unit comes from ostree upstream, but forms part of our
Ignition sequence.  Make it required by ignition-complete.target
so that if it fails we get the same OnFailure= behavior.

Making this change as during development `ignition-ostree-mount-sysroot.service`
wasn't running which caused this unit to fail; the root cause would have been
a bit more obvious with this change.
@jlebon
Copy link
Member

jlebon commented Oct 30, 2019

Not totally against, though ignition-complete.target is meant to be a master on/off switch for whether to run Ignition (see coreos/ignition-dracut#55). So it's only really useful on first boot. Adding non-firstboot-only services under it means there will be different behaviours wrt failures between first and subsequent boots for that unit, and can also give off the impression that ostree-prepare-root.service is a firstboot-only service too.

Hmm actually, ostree-prepare-root.service already has OnFailure=emergency.target. So maybe we just need:

diff --git a/src/boot/ostree-prepare-root.service b/src/boot/ostree-prepare-root.service
index 63357581..1017c2fd 100644
--- a/src/boot/ostree-prepare-root.service
+++ b/src/boot/ostree-prepare-root.service
@@ -22,6 +22,7 @@ DefaultDependencies=no
 ConditionKernelCommandLine=ostree
 ConditionPathExists=/etc/initrd-release
 OnFailure=emergency.target
+OnFailureJobMode=isolate
 After=sysroot.mount
 Before=initrd-root-fs.target

for the same reason as ignition-complete.target?

@cgwalters
Copy link
Member Author

Yep, you're totally right. Will do.

@cgwalters cgwalters closed this Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants