Skip to content
This repository was archived by the owner on Aug 25, 2021. It is now read-only.

Conversation

@dustymabe
Copy link
Member

@dustymabe dustymabe commented Mar 30, 2020

We want to run the teardown after all other Ignition stages
have run because some platforms (like Packet) do remote status
reporting for each Ignition stage. Since we are tearing down
the networking using an ExecStop we need to make sure we run
the ExecStop after any other ignition*.service unit's ExecStop.
The only other one right now is ignition-mount that has an ExecStop
for doing an unmount. Since the ordering for ExecStop is the
opposite of ExecStart we need to use Before=ignition-mount.service.

Partial fix for coreos/fedora-coreos-tracker#440

This would most likely not be necessary if Ignition cached an
empty result: coreos/ignition#950

This isn't needed because the meat of this unit runs in the ExecStop.
@bgilbert
Copy link
Contributor

I actually implemented exactly this fix this weekend, for Packet status reporting, before settling on coreos/ignition#952 instead.

In principle I think this PR would break propagation of NM configs into the real root, in cases where Ignition has mounted a filesystem onto the destination path, because it'll cause Ignition to unmount that FS too early. (This wouldn't apply to the typical case where /etc/NetworkManager is in /sysroot, though.)

@bgilbert
Copy link
Contributor

(To be clear, I'm arguing that we shouldn't take this approach; see coreos/fedora-coreos-tracker#440 (comment).)

@dustymabe
Copy link
Member Author

In principle I think this PR would break propagation of NM configs into the real root, in cases where Ignition has mounted a filesystem onto the destination path, because it'll cause Ignition to unmount that FS too early. (This wouldn't apply to the typical case where /etc/NetworkManager is in /sysroot, though.)

Thanks for bringing this up. I'm not sure I fully understand so I'll ask some questions :)

Are there cases where /etc/ isn't in the root filesystem? Or are you talking about cases where the root filesystem is getting rewritten? Do we support that?

(To be clear, I'm arguing that we shouldn't take this approach; see coreos/fedora-coreos-tracker#440 (comment).)

+1. Though it sounds like you are still arguing for a change to be made here to make it not race. i.e. we'd want to flip from Before=ignition-mount.service to After= so that we guarantee the teardown happens before the unmount.

@bgilbert
Copy link
Contributor

Discussed in IRC. I agree that /etc/NetworkManager not being in the root FS is an... obscure case. Objection withdrawn.

…n units

We want to run the teardown after all other Ignition stages
have run because some platforms (like Packet) do remote status
reporting for each Ignition stage. Since we are tearing down
the networking using an ExecStop we need to make sure we run
the ExecStop *after* any other ignition*.service unit's ExecStop.
The only other one right now is ignition-mount that has an ExecStop
for doing an unmount. Since the ordering for ExecStop is the
opposite of ExecStart we need to use `Before=ignition-mount.service`.

Partial fix for coreos/fedora-coreos-tracker#440

This would most likely not be necessary if Ignition cached an
empty result: coreos/ignition#950
@dustymabe dustymabe force-pushed the dusty-teardown-ordering branch from 857d2ab to ded5d30 Compare March 30, 2020 15:37
@dustymabe
Copy link
Member Author

ok marking this as ready for review and doing some final testing

@dustymabe dustymabe marked this pull request as ready for review March 30, 2020 15:38
Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

I think we could generalize this to just "tear down networking on switchroot" instead of making it about Ignition.

Hmm, a more "technically correct" approach is to tie this service to whether networking was brought up. So e.g. it'd be a service that gets pulled in by network.target in the Ignition generator, and it would naturally get stopped via Conflicts=initrd-switch-root.target on switchroot. This also meshes better with the conditional networking work going on.

Anyway, not against getting this easy fix in and rewiring this in the future!

@dustymabe
Copy link
Member Author

I think we could generalize this to just "tear down networking on switchroot" instead of making it about Ignition.

Yeah you're probably right. I'm not opposed to doing that in the future.

Hmm, a more "technically correct" approach is to tie this service to whether networking was brought up. So e.g. it'd be a service that gets pulled in by network.target in the Ignition generator, and it would naturally get stopped via Conflicts=initrd-switch-root.target on switchroot. This also meshes better with the conditional networking work going on.

Anyway, not against getting this easy fix in and rewiring this in the future!

+1 thanks for that. I think let's get this fix into the a new testing release to fix the regression (will merge after more testing) and then we can do a better fix for all of this in the next testing release that's coming out next week.

@dustymabe dustymabe merged commit 793d0ef into coreos:master Mar 30, 2020
@dustymabe dustymabe deleted the dusty-teardown-ordering branch April 21, 2020 20:47
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.

5 participants