boot hang: "is networkd running" was the wrong question
This section did nothing on the machine it was written for, and the machine was losing two minutes on every boot the whole time. Both stacks can be ACTIVE at once. Here NetworkManager owned enp1s0 and wlp2s0, systemd-networkd was up and managing not one of eighty links, and systemd-networkd-wait-online still burned its full timeout — the journal has `Timeout occurred while waiting for network connectivity`, 18:31:05 to 18:33:05. The old predicate required networkd to be INACTIVE, so it reported "nothing to fix — networkd is in charge" and moved on. What decides it is whether networkd CONFIGURED a link, which networkctl will say: a link it owns reads `configured`, one it ignores reads `unmanaged`. If every link is unmanaged the wait can never be satisfied, and masking is safe. A missing networkctl counts as "yes it does". An unanswerable question must not read as permission to mask — the failure mode on the other side of this is a VPS that comes up with no network and no ssh. `network_manager_name` had the same blind spot and printed "NetworkManager" for the both-running case, which is exactly the case that was being got wrong. It now describes the machine instead of picking a winner. Verified against this box: configures-a-link no, spurious yes, reported as "NetworkManager (networkd is up but configures nothing)". Masked here by hand; NetworkManager-wait-online still provides network-online.target, so nothing that orders after the network lost its ordering. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Officer-Session: de3ed4e6-f88a-429c-94e6-a760336ba83b
This commit is contained in:
@@ -1170,18 +1170,22 @@ elif ! skip; then
|
||||
echo ""
|
||||
info "Boot hang — a unit that can add two minutes to every boot"
|
||||
echo " On a machine where NetworkManager owns the network, systemd-networkd"
|
||||
echo " runs nothing — but systemd-networkd-wait-online is still enabled, and"
|
||||
echo " waits for a link that will never come up. It gives up after its full"
|
||||
echo " timeout, every single boot."
|
||||
echo " configures nothing — but systemd-networkd-wait-online is still"
|
||||
echo " enabled, and waits for a link that will never come up. It gives up"
|
||||
echo " after its full timeout, every single boot."
|
||||
echo ""
|
||||
echo " Note both daemons can be running at once. What decides it is whether"
|
||||
echo " networkd CONFIGURED a link, not whether it is up."
|
||||
echo ""
|
||||
echo " network managed by: $(network_manager_name)"
|
||||
echo " that unit took: ${WAIT_ONLINE_TIME:-it did not run} on this boot"
|
||||
|
||||
if ! wait_online_is_spurious; then
|
||||
echo ""
|
||||
echo " systemd-networkd is live here, so that unit is doing real work."
|
||||
echo " systemd-networkd configures a link here, so that unit is doing"
|
||||
echo " real work."
|
||||
echo " Masking it would be how this machine comes up with no network."
|
||||
SUMMARY+=("Boot hang: nothing to fix — networkd is in charge")
|
||||
SUMMARY+=("Boot hang: nothing to fix — networkd configures a link")
|
||||
else
|
||||
echo ""
|
||||
if is_role dev; then
|
||||
|
||||
Reference in New Issue
Block a user