Systemd-networkd-wait-online-service fails during boot

HI all :wave:

Every time I boot my Fedora 39, it hangs for a while trying to start systemd-networkd-wait-online-service until it finally gives up.

❯ systemctl status systemd-networkd-wait-online.service 
× systemd-networkd-wait-online.service - Wait for Network to be Configured
     Loaded: loaded (/usr/lib/systemd/system/systemd-networkd-wait-online.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: failed (Result: exit-code) since Sat 2023-12-02 20:40:49 -03; 42min ago
       Docs: man:systemd-networkd-wait-online.service(8)
    Process: 1363 ExecStart=/usr/lib/systemd/systemd-networkd-wait-online (code=exited, status=1/FAILURE)
   Main PID: 1363 (code=exited, status=1/FAILURE)
        CPU: 19ms

dez 02 20:38:49 fedoracosta systemd[1]: Starting systemd-networkd-wait-online.service - Wait for Network to be Configured...
dez 02 20:40:49 fedoracosta systemd-networkd-wait-online[1363]: Timeout occurred while waiting for network connectivity.
dez 02 20:40:49 fedoracosta systemd[1]: systemd-networkd-wait-online.service: Main process exited, code=exited, status=1/FAILURE
dez 02 20:40:49 fedoracosta systemd[1]: systemd-networkd-wait-online.service: Failed with result 'exit-code'.
dez 02 20:40:49 fedoracosta systemd[1]: Failed to start systemd-networkd-wait-online.service - Wait for Network to be Configured.

I’ve read on this thread that I should probably not have both systemd-networkd and NetworkManager enabled at the same time, and that if I were to choose one of them, I should favor systemd-networkd – but then I would lose GUI configuration. Does that recommendation still hold? What would I lose if I chose to disable systemd-networkd instead?

Using NetworkManager expects you to disable systemd-networkd:

sudo systemctl disable systemd-networkd.service

If you want to keep enabled both NetworkManager and systemd-networkd, then disable just the relevant wait-online service:

sudo systemctl disable systemd-networkd-wait-online.service

In general case, it depends on what service holds your connection and which other services rely on that specific connection.

Thanks @vgaetera ! It seems a lot of other services depend on systemd-networkd-wait-online-service:

❯ systemctl list-dependencies --reverse systemd-networkd-wait-online.service
systemd-networkd-wait-online.service
● └─network-online.target
●   ├─dnf-makecache.timer
○   ├─docker.service
○   ├─iscsi.service
○   ├─nfs-idmapd.service
○   ├─nfs-mountd.service
○   ├─nfs-server.service
●   ├─rpc-statd-notify.service
○   └─rpc-statd.service

Maybe it is safer to disable systemd-networkd as a whole? :thinking:

systemd-networkd is disabled by default on Fedora.
What is your reason to keep it enabled?

I just disabled it, everything seems to be working fine. Will keep it that way. Thanks!

Frankly, I don’t recall explicitly enabling it :person_shrugging:

It is a “before” dependency, meaning if systemd-networkd-wait-online is enabled it must come before network-online.target. Same for NetworkManager-wait-online.service.