dracut: run emergency.target on ignition/torcx service unit failure#28
Merged
jepio merged 1 commit intoflatcar-masterfrom Sep 9, 2021
Merged
dracut: run emergency.target on ignition/torcx service unit failure#28jepio merged 1 commit intoflatcar-masterfrom
jepio merged 1 commit intoflatcar-masterfrom
Conversation
Right now, when ignition fails during boot the following happens: 1. ignition service fails, which fails initrd.target fails and starts emergency.target 2. initrd-parse-etc.service is already starting and launches initrd-fs.target and initrd-cleanup.service 3. initrd-cleanup.service isolates initrd-swithc-root.target 4. emergency.service is stopped and starts default.target again 5. initrd.target starts ignition services again 6. loop back to 1. This is a boot loop that makes it hard for users to figure out what is wrong with their ignition config. This appears to be unintentional, and something observed in CoreOS and Fedora CoreOS as well. Apparently, for a brief while systemd did not allow OnFailure clauses in targets. This was fixed in systemd, but coreos shipped this fix as well coreos/ignition-dracut#188. So add OnFailure clauses to ignition units to ensure boot stops right there. Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
krnowak
approved these changes
Sep 8, 2021
sayanchowdhury
approved these changes
Sep 9, 2021
Member
|
Wonderful, it stops with a red error message about the wrong configuration, and shows the dracut emergency shell prompt ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dracut: run emergency.target on ignition/torcx service unit failure
This PR isolates emergency.target when ignition units fail, ensuring that we don't end up with a boot loop in initramfs.
How to use
Testing done
Tested with invalid ignition configs from flatcar/Flatcar#434 and flatcar/Flatcar#468. In both cases the boot now stops and the user sees the ignition error on the console.