2

Symptons same on every release after 16.04.3.

At boot, system hangs on the Ubuntu screen with 4 flashing dots for over 2 minutes.

Ran systemd blame which indicated systemd-networkd-wait-online.service took 1 minute and 38 seconds to run and NetworkManager-wait-online.service took 10 seconds to run.

Ran ubuntu-bug systemd-networkd-wait-online.service which returns that the bug cannot be reported because it concerns a package that is not installed.

Without Apport working, I am unsure how to file the bug on Launchpad.

6 Answers6

4

Existing answers have suggested editing files in /lib in place or copying them to /etc. I recommend doing the following:

sudo systemctl edit --full systemd-networkd-wait-online.service

Then you can make modifications in the file, as described in the existing answers:

ExecStart=/lib/systemd/systemd-networkd-wait-online --timeout 1

This way systemd will take care of the files for you and it will survive upgrades. If you need to restore the default behavior you can delete the respective file in /etc/systemd/system/.

LiveWireBT
  • 28,763
3

Same problem here with Artful.

2min 52ms systemd-networkd-wait-online.service

As a workaround you can add a timeout for the service. To do that edit the file /lib/systemd/system/systemd-networkd-wait-online.service and adjust the line that starts the service:

ExecStart=/lib/systemd/systemd-networkd-wait-online --timeout 1

Setting the timeout to 1 doesn't seem to have any implications as there's another service with the exact same task (NetworkManager-wait-online.service).

mniess
  • 10,546
  • Why adding a timeout work? Also you are using artful, which is not specific to the version specified, which is xenial. – Cynplytholowazy Sep 18 '17 at 05:56
  • sorry for the delay of my answer... I did add a timeout since I do not want to wait 2 min on bootup. – Eric Keller Nov 28 '17 at 18:37
  • Works like charm! – Armin Aug 08 '18 at 21:50
  • Btw. after I've performed a apt-get dist-upgrade the contents in /lib/systemd/system/systemd-networkd-wait-online.service has been restored. The --timeout 1 was gone. So this workaround is not update-safe. – Armin Nov 19 '18 at 22:00
1

You can make ExecStart=/lib/systemd/systemd-networkd-wait-online --timeout 1 permanent by copying the modified systemd-networkd-wait-online.service file from /lib/systemd/system/ to /etc/systemd/system/ directory, using the following command.

sudo cp /lib/systemd/system/systemd-networkd-wait-online.service /etc/systemd/system/
1

You can create a directory /etc/systemd/system/systemd-networkd-wait-online.service.d/ and file /etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf with

[Service]
ExecStart=/lib/systemd/systemd-networkd-wait-online --timeout 1
1

Most people don't even need to wait for network to be up when booting. In this case you can simply disable the waiting:

The above link explains what the service does and tells you how to disable it, as most users without an IT department would want to do.

0

The fastest solution I found:

systemctl mask systemd-networkd-wait-online.service

Q.E.D.

Hvisage
  • 101