diff --git a/dracut/30ignition/coreos-gpt-setup@.service b/dracut/30ignition/coreos-gpt-setup@.service index d312b6c..14cb3ab 100644 --- a/dracut/30ignition/coreos-gpt-setup@.service +++ b/dracut/30ignition/coreos-gpt-setup@.service @@ -13,6 +13,9 @@ After=%i.device # with udev activity generated by sgdisk Before=ignition-setup-base.service ignition-setup-user.service ignition-disks.service +OnFailure=emergency.target +OnFailureJobMode=isolate + [Service] Type=oneshot RemainAfterExit=yes diff --git a/dracut/30ignition/coreos-teardown-initramfs.service b/dracut/30ignition/coreos-teardown-initramfs.service index 4821951..a2131af 100644 --- a/dracut/30ignition/coreos-teardown-initramfs.service +++ b/dracut/30ignition/coreos-teardown-initramfs.service @@ -22,7 +22,6 @@ Before=ignition-complete.target Conflicts=initrd-switch-root.target umount.target Before=initrd-switch-root.target -# Make sure if ExecStart= fails, the boot fails OnFailure=emergency.target OnFailureJobMode=isolate diff --git a/dracut/30ignition/ignition-complete.target b/dracut/30ignition/ignition-complete.target index 0a4c947..6241b1d 100644 --- a/dracut/30ignition/ignition-complete.target +++ b/dracut/30ignition/ignition-complete.target @@ -9,13 +9,6 @@ Documentation=https://github.com/coreos/ignition ConditionPathExists=/etc/initrd-release Before=initrd.target -# initrd.target has OnFailureJobMode=replace-irreversibly, which seems to -# cause unit restart loops in the initramfs if one of our units fails. Thus -# we intercept Ignition unit failures here and isolate to emergency.target. -# https://github.com/coreos/ignition-dracut/issues/115 -OnFailure=emergency.target -OnFailureJobMode=isolate - # Make sure we stop all the units before switching root Conflicts=initrd-switch-root.target umount.target Conflicts=dracut-emergency.service emergency.service emergency.target diff --git a/dracut/30ignition/ignition-disks.service b/dracut/30ignition/ignition-disks.service index 241f5d8..8d58639 100644 --- a/dracut/30ignition/ignition-disks.service +++ b/dracut/30ignition/ignition-disks.service @@ -21,6 +21,9 @@ Before=ignition-mount.service Before=initrd-root-device.target Before=sysroot.mount +OnFailure=emergency.target +OnFailureJobMode=isolate + # This stage requires udevd to detect disk partitioning changes. Requires=systemd-udevd.service After=systemd-udevd.service diff --git a/dracut/30ignition/ignition-fetch.service b/dracut/30ignition/ignition-fetch.service index 269a8b4..8ccf196 100644 --- a/dracut/30ignition/ignition-fetch.service +++ b/dracut/30ignition/ignition-fetch.service @@ -13,6 +13,8 @@ After=ignition-setup-base.service After=ignition-setup-user.service Before=ignition-disks.service +OnFailure=emergency.target +OnFailureJobMode=isolate # Network may be used to fetch userdata content. After=network.target diff --git a/dracut/30ignition/ignition-files.service b/dracut/30ignition/ignition-files.service index 704cc26..9f4b124 100644 --- a/dracut/30ignition/ignition-files.service +++ b/dracut/30ignition/ignition-files.service @@ -5,6 +5,9 @@ ConditionPathExists=/etc/initrd-release DefaultDependencies=false Before=ignition-complete.target +OnFailure=emergency.target +OnFailureJobMode=isolate + # Stage order: setup -> fetch -> disks -> mount -> files. After=ignition-mount.service diff --git a/dracut/30ignition/ignition-mount.service b/dracut/30ignition/ignition-mount.service index b32c93f..f222826 100644 --- a/dracut/30ignition/ignition-mount.service +++ b/dracut/30ignition/ignition-mount.service @@ -8,7 +8,6 @@ Before=ignition-complete.target # Make sure ExecStop= runs before we switch root Before=initrd-switch-root.target -# Make sure if ExecStop= fails, the boot fails OnFailure=emergency.target OnFailureJobMode=isolate diff --git a/dracut/30ignition/ignition-remount-sysroot.service b/dracut/30ignition/ignition-remount-sysroot.service index 154bcd8..f004d20 100644 --- a/dracut/30ignition/ignition-remount-sysroot.service +++ b/dracut/30ignition/ignition-remount-sysroot.service @@ -8,6 +8,9 @@ ConditionPathExists=/etc/initrd-release DefaultDependencies=no Before=ignition-diskful.target +OnFailure=emergency.target +OnFailureJobMode=isolate + After=sysroot.mount ConditionPathIsReadWrite=!/sysroot diff --git a/dracut/30ignition/ignition-setup-base.service b/dracut/30ignition/ignition-setup-base.service index d58c204..6a43b44 100644 --- a/dracut/30ignition/ignition-setup-base.service +++ b/dracut/30ignition/ignition-setup-base.service @@ -5,6 +5,9 @@ ConditionPathExists=/etc/initrd-release DefaultDependencies=false Before=ignition-complete.target +OnFailure=emergency.target +OnFailureJobMode=isolate + # Stage order: setup -> fetch -> disks -> mount -> files. Before=ignition-fetch.service diff --git a/dracut/30ignition/ignition-setup-user.service b/dracut/30ignition/ignition-setup-user.service index b387f2b..cde38c6 100644 --- a/dracut/30ignition/ignition-setup-user.service +++ b/dracut/30ignition/ignition-setup-user.service @@ -5,6 +5,9 @@ ConditionPathExists=/etc/initrd-release DefaultDependencies=false Before=ignition-complete.target +OnFailure=emergency.target +OnFailureJobMode=isolate + # Stage order: setup -> fetch -> disks -> mount -> files. Before=ignition-fetch.service diff --git a/dracut/30ignition/ignition-subsequent.target b/dracut/30ignition/ignition-subsequent.target index b3d5b47..95ae838 100644 --- a/dracut/30ignition/ignition-subsequent.target +++ b/dracut/30ignition/ignition-subsequent.target @@ -7,10 +7,6 @@ Documentation=https://github.com/coreos/ignition ConditionPathExists=/etc/initrd-release Before=initrd.target -# See comments in ignition-complete.target -OnFailure=emergency.target -OnFailureJobMode=isolate - # Make sure we stop all the units before switching root Conflicts=initrd-switch-root.target umount.target Conflicts=dracut-emergency.service emergency.service emergency.target