31

When I want to boot up my laptop it shows this error to me:

[FAILED] Failed to start Dispatcher daemon for systemd-networkd

[and this is what happens]

1

Please help me.

eshirvana
  • 145
  • 9
Stefanx
  • 411
  • 1
  • 4
  • 4

4 Answers4

43

Ubuntu can use either systemd-networkd (default on servers) or NetworkManager (default on desktops) to manage networking. As a result there are two wait services: NetworkManager-wait-online.service and systemd-networkd-wait-online.service. If you have the wrong one enabled (or as in my case, both enabled), then the service will timeout. You can check what you have enabled with the following command:

~# systemctl is-enabled NetworkManager-wait-online.service systemd-networkd-wait-online.service
enabled
enabled

In this instance, as you can see, I have both enabled. You can further see which service is being used by asking systemd:

# systemctl is-enabled NetworkManager.service systemd-networkd.service
enabled
enabled

As you can see, on my system, both network services are enabled. I'm running a desktop machine, so NetworkManager is mostly likely to be the correct service. I can validate this by looking in /etc/netplan/ and seeing that networkmanager.yaml exists. Further inspection of the netplan configuration files validates that NetworkManager is aware of all the interfaces on my machine. So I disable systemd-networkd

# systemctl disable systemd-networkd.service
Removed /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service.
Removed /etc/systemd/system/sockets.target.wants/systemd-networkd.socket.
Removed /etc/systemd/system/multi-user.target.wants/systemd-networkd.service.

Note that this has also disabled the wait service, and some associated other services. So this is significantly better than just disabling the wait service. Now my boot time has reduced from just over two minutes, to less than 10 seconds.

31

It sounds as if you have >1 systemd.network(5) configuration file in /etc/systemd/network (or have [Match] section specifying >1 interface with a wildcard) with none set with the RequiredForOnline=false directive in the [Link] section. In that case, systemd-networkd-wait-online.service will expect all the systemd-networkd managed interfaces to reach a routable operational state.

Though setting that directive will also make it ignored by systemd-networkd-wait-online.service entirely, which is also probably not what you want. If you don't care about ordering against the network-online.target, then you might as well disable and/or mask the unit.

If you would prefer to retain the advantages of ordering dependencies against network-online.target, then the easiest way around this that I've found is to simply use the --any switch. Either create the file /etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf or use sudo systemctl edit systemd-networkd-wait-online.service (which will also create the same file) and include these lines...

[Service]
ExecStart=
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --any

A subsequent sudo systemctl daemon-reload and sudo systemctl restart systemd-networkd-wait-online.service should tell you immediately whether it worked or not.

Alternatively, you can use the --interface= and/or --ignore= switches with systemd-networkd-wait-online. These may be used in place of, or in conjunction with, the --any switch shown above. If used with the --any switch, it will only consider those interfaces passed to --interface=, or not explicitly disregarded with --ignore=, when determining whether the machine has reached an online state.

MarcoZen
  • 281
7

Your system is not freezing during the boot process, it's entered a waiting state for the network devices to be completely configured before continuing on. The ultimate fix will come from an examination of of the configuration files in /etc/systemd/network and the service logs as revealed by journalctl -xe | grep networkd, focusing your attention on any links whose status in the report from networkctl status -a is not listed as "configured". This has been known to happen when IPv6 is unavailable or misconfigured, but also for various other reasons.

You should reboot the system in recovery mode via your bootloader (GRUB, rEFInd, etc.) and select the root option from the menu that appears. From there you can examine the system with the above-mentioned commands and/or enable debugging logs for the service by creating a new directory with mkdir /etc/systemd/system/systemd-networkd.service.d and then creating a new file in it called override.conf (e.g. sudoedit /etc/systemd/system/systemd-networkd.service.d/override.conf) with the following contents:

[Service]
Environment=SYSTEMD_LOG_LEVEL=debug

You can test the success of your modifications to the files in /etc/systemd/network while still in recovery mode using the command /usr/lib/systemd/systemd-networkd-wait-online && echo $?. If you've fixed the problem the output will be 0. Failing all else, you can disable the service entirely with sudo systemctl disable systemd-netword-wait-online.service


Relevant man pages:

0

interesting thing is if I just install KDE it works fine, once installed the ubuntu-desktop, it breaks a lot of things

Wang
  • 725