-
Notifications
You must be signed in to change notification settings - Fork 186
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM.
1f5c78d
to
ebb14e4
Compare
tests/generator/test_args.py
Outdated
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''') |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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".
a119c15
to
ba03349
Compare
ba03349
to
56b149c
Compare
There was a problem hiding this 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) |
There was a problem hiding this comment.
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...
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
make check
successfully.make check-coverage
).