Skip to content
This repository was archived by the owner on Sep 18, 2020. It is now read-only.

dracut: on ec2, disable systemd-networkd if ignition fails - #118

Merged
csssuf merged 1 commit into
coreos:masterfrom
csssuf:ec2-networkd-failure
Jun 27, 2017
Merged

csssuf merged 1 commit into
coreos:masterfrom
csssuf:ec2-networkd-failure

Conversation

@csssuf

@csssuf csssuf commented Jun 22, 2017 •

Copy link
Copy Markdown
Contributor

If ignition fails when running on EC2, systemd-networkd should be stopped so that the instance's status checks fail and indicate ignition's failure.

Fixes coreos/bugs#1890.

@csssuf
csssuf force-pushed the ec2-networkd-failure branch from 6003f9c to e756c90 Compare June 22, 2017 01:24
@csssuf
csssuf requested a review from bgilbert June 23, 2017 00:05
@csssuf
csssuf force-pushed the ec2-networkd-failure branch from e756c90 to 7ff3707 Compare June 26, 2017 23:55
add_requires ignition-quench.service
fi

if [[ $(cmdline_arg coreos.oem.id) == "ec2" ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably deserves a comment.

Comment thread dracut/30ignition/ignition-generator Outdated
if [[ $(cmdline_arg coreos.oem.id) == "ec2" ]]; then
mkdir -p ${UNIT_DIR}/emergency.service.d
cat > ${UNIT_DIR}/emergency.service.d/10-conflict-networkd.conf <<-EOF
[Unit]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<<-EOF is not working here. You could switch to tabs, but that seems fragile. Probably better to use <<EOF and not indent.

Comment thread dracut/30ignition/ignition-generator Outdated

if [[ $(cmdline_arg coreos.oem.id) == "ec2" ]]; then
mkdir -p ${UNIT_DIR}/emergency.service.d
cat > ${UNIT_DIR}/emergency.service.d/10-conflict-networkd.conf <<-EOF

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emergency.service is an implementation detail of emergency.target, and the latter is probably the unit that should conflict. (Or maybe both should, e.g. sysroot-boot.service.)

dracut-emergency.service is a different thing altogether and should also conflict: it might be invoked for certain boot failures caused by a bad Ignition config, such as a config that makes /usr unmountable.

Since you need to add multiple conflicts, it's probably easiest to add them as a drop-in on systemd-networkd.service.

If ignition fails when running on EC2, systemd-networkd should be
stopped so that the instance's status checks fail and indicate
ignition's failure.
@csssuf
csssuf force-pushed the ec2-networkd-failure branch from 7ff3707 to 9bee624 Compare June 27, 2017 01:16
@csssuf

csssuf commented Jun 27, 2017

Copy link
Copy Markdown
Contributor Author

Updated with requested changes.

@csssuf
csssuf merged commit 439ab21 into coreos:master Jun 27, 2017
@csssuf
csssuf deleted the ec2-networkd-failure branch June 27, 2017 20:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants