Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

networkd: make s-n-wait-online wait for at least one routable interface #482

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

slyon
Copy link
Collaborator

@slyon slyon commented Jun 24, 2024

Description

wait-online: wait for 'routable' state, if corresponding IPs are defined

Generally, we should be waiting on "routable" state (instead of "degraded") when we have static IP/dhcp4/dhcp6/RA.

Our spec defines "at least one interface MUST be up on the link layer and have received layer 3 (IP) configuration" (ignoring link-local).

We now start two separate systemd-networkd-wait-online processes. One waiting for "carrier" & "degraded" interfaces (including the "routable" ones), not using "--any". Another one waiting just for "routable" interfaces, combined with "--any". Both blocking "network-online.target".

FR-7838

Checklist

  • Runs make check successfully.
  • Retains 100% code coverage (make check-coverage).
  • New/changed keys in YAML format are documented.
  • (Optional) Adds example YAML for new feature.
  • (Optional) Closes an open bug in Launchpad.

@slyon slyon requested review from daniloegea and enr0n June 24, 2024 15:57
Copy link

@enr0n enr0n left a comment

Choose a reason for hiding this comment

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

Nice! LGTM.

Comment on lines 193 to 194
ExecStart=/lib/systemd/systemd-networkd-wait-online -i lo:carrier -i eth99.42:carrier -i eth99.44:degraded
ExecStart=/lib/systemd/systemd-networkd-wait-online --any -o routable -i eth99.43 -i br0\n''')
Copy link
Collaborator Author

@slyon slyon Jun 25, 2024

Choose a reason for hiding this comment

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

Actually, I think we still want to have the "routable" interfaces listed in the first command line, too. As we also want those to be in "degraded"/"carrier" (link-local) state – in addition to at least one being routable.

Copy link
Collaborator Author

@slyon slyon Jun 27, 2024

Choose a reason for hiding this comment

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

Now included in 56b149c

Generally, we should be waiting on "routable" state (instead of "degraded") when we have static IP/dhcp4/dhcp6/RA.

Our spec defines "at least one interface MUST be up on the link layer and have received layer 3 (IP) configuration" (ignoring link-local).

We now start two separate "systemd-networkd-wait-online" processes. One waiting for "carrier" & "degraded" interfaces, not using "--any". Another one waiting just for "routable" interfaces, combined with "--any". Both blocking "network-online.target".
@slyon slyon force-pushed the s-n-wait-online-routable branch 3 times, most recently from a119c15 to ba03349 Compare June 27, 2024 15:00
Copy link
Collaborator

@daniloegea daniloegea left a comment

Choose a reason for hiding this comment

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

It seems to be working as intended.

I just left one thought about bonds. I'm not sure if we should wait for carrier on all the members by default. The system doesn't need to have carrier on all the bond members to be online.

But to have it waiting for any member we'd need to create groups of members for each bond and have one call to wait-online --any for each group... maybe we could consider that in the future. Maybe we should recommend that bond members should be optional.

@@ -1546,58 +1550,40 @@ _netplan_networkd_write_wait_online(const NetplanState* np_state, const char* ro
* come online.
*/
if (!(def->optional || def->activation_mode)) {
WaitOnlineData* d = g_malloc0(sizeof(WaitOnlineData));
d->ignore_carrier = def->ignore_carrier;

// Check if we have any IP configuration
// bond and bridge members will never ask for link-local addresses (see above)
Copy link
Collaborator

Choose a reason for hiding this comment

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

thought: I wonder if we really should wait for all the bond members by default. One might have a bunch of the bond members disconnected for whatever reason and the system might still be online if at least one member is connected. I'd say it would be better to use --any for groups of interfaces that are members of the same bond. That would complicate the implementation though. I suppose we at least need to recommend setting all the members as optional (but not the bond itself) to avoid having anything blocking on the wait-online target...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants