Don't block the desktop on network-online at boot

graphical.target was gated on network-online.target: cups-browsed orders
itself After=network-online.target and sits in multi-user.target, so the
session waited for NetworkManager-wait-online (DHCP/Wi-Fi association)
before coming up. On the bench VM that was ~140ms, but it's the classic
multi-second boot stall on real Wi-Fi.

Mask NetworkManager-wait-online.service so network-online.target is
reached immediately and nothing in the boot waits for connectivity;
NetworkManager still comes up and cups-browsed browses once the link is
live. Mirrors the existing systemd-networkd-wait-online mask. Enabled at
install (enable-services.sh) and masked on existing installs via
migration.

Verified on a fresh boot: the graphical.target critical chain no longer
passes through network-online.target / NetworkManager-wait-online.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-07-20 10:34:26 -07:00
co-authored by Claude Fable 5
parent 86fd228cda
commit 5232505c12
2 changed files with 20 additions and 0 deletions
+5
View File
@@ -7,5 +7,10 @@ systemctl enable linux-modules-cleanup.service
systemctl enable docker.socket systemctl enable docker.socket
systemctl enable systemd-resolved.service systemctl enable systemd-resolved.service
systemctl enable NetworkManager.service systemctl enable NetworkManager.service
# Don't let network-online.target (pulled in by cups-browsed) hold up
# graphical.target waiting for DHCP/Wi-Fi association. Nothing in the session
# needs to block on the network. Mirrors the systemd-networkd-wait-online mask
# in install/hardware/network.sh.
systemctl mask NetworkManager-wait-online.service
systemctl enable power-profiles-daemon.service systemctl enable power-profiles-daemon.service
systemctl enable sddm.service systemctl enable sddm.service
+15
View File
@@ -0,0 +1,15 @@
echo "Stop waiting for the network before showing the desktop"
as_root() {
if (( EUID == 0 )); then
"$@"
else
sudo "$@"
fi
}
# graphical.target was gated on network-online.target (cups-browsed orders
# itself after it), so the desktop waited for DHCP/Wi-Fi association at boot.
# Nothing in the session needs to block on the network; mask the wait so
# network-online no longer delays boot. Mirrors the systemd-networkd variant.
as_root systemctl mask NetworkManager-wait-online.service >/dev/null 2>&1 || true