Ubuntu 15.04 network manager causing slow boot
Solution 1
You can change the timeout of nm-online to something like 10:
Edit /lib/systemd/system/NetworkManager-wait-online.service
as root or using sudo.
Look for the lines:
[Service]
Type=oneshot
ExecStart=/usr/bin/nm-online -s -q --timeout=30
Change 30
to whatever you like. 10
worked well for me.
But beware this may break services that depend on it.
Solution 2
I faced the same problem before, NetworkManager
taking about 8 seconds. There are three ways to solve this problem:
-
Disable connecting automatically for your connection
edit connections > select your connection > edit and disable connecting automatically
You can simply disable
Enable networking
from network indicator.-
You can disable the service by running this command
systemctl disable NetworkManager-wait-online.service
Solution 3
Disable dhcp
on eth0
interface.
If you have dhcp configured on eth0
, and the wire is not connected, the system will keep looking for an ip address to assign your device, until the request for ip address times out, before the boot continues.
To verify if this would solve your problem, do
sudo /etc/init.d/networking restart
and take note of how long it takes for this service to restart.
The service will restart in no time, if there's no issues around eth0
interface, else, a long delay and timeout will be presented.
Related videos on Youtube
Comments
-
alx.balmus almost 2 years
Since upgrading from 14.10 to 15.04 a few days ago the boot time, grub OS screen to login screen, has increased from 12 seconds to about 40. This is my systemd-analyze critical-chain output:
The time after the unit is active or started is printed after the "@" character. The time the unit takes to start is printed after the "+" character. graphical.target @37.433s └─multi-user.target @37.433s └─getty.target @37.432s └─[email protected] @37.432s └─systemd-user-sessions.service @35.906s +9ms └─remote-fs.target @35.904s └─media-XalnasStorage.mount @35.849s +53ms └─network-online.target @35.846s └─network.target @11.636s └─NetworkManager.service @11.502s +132ms └─basic.target @11.487s └─sockets.target @11.487s └─avahi-daemon.socket @11.487s └─sysinit.target @11.485s └─networking.service @11.333s +65ms └─apparmor.service @11.269s +63ms └─local-fs.target @11.268s └─media-TStore1.mount @10.331s +936ms └─local-fs-pre.target @10.328s └─systemd-remount-fs.service @10.320s +6ms └─systemd-fsck-root.service @10.303s +15ms └─systemd-journald.socket @151ms └─-.slice @150ms
There seems to be a problem with the network manager service.
The top of the systemd-analyze blame log looks like this:
24.209s NetworkManager-wait-online.service 10.056s systemd-udev-settle.service 1.499s plymouth-quit-wait.service 936ms media-TStore1.mount 487ms dev-disk-by\x2duuid-920a92b0\x2d6e65\x2d4a7a\x2d855d\x2d81cb436cd85f.device 425ms [email protected] 421ms [email protected] 407ms media-TStore2.mount 267ms gpu-manager.service 215ms plymouth-read-write.service 209ms [email protected] 132ms NetworkManager.service 83ms ModemManager.service
The complete version can be seen here.
Also the systemd-analyze plot output can be seen here.
Thanks for your time.
-
Suraj Jain over 7 yearsAtleast mark the answer as best answer.
-
Sandeep C over 6 yearsWhat is the use of this service?
-
DrGorilla.eth about 6 years@SandeepC Wait for the network to goes online, in case networking is needed for booting (so not realy needed for most of the desktop users;) see askubuntu.com/questions/1018576/…
-
-
alx.balmus about 9 yearsThis answer greatly improved the boot time on my system. The top of the systemd-analyze blame output now looks like this: 9.861s systemd-udev-settle.service 6.920s NetworkManager-wait-online.service The boot time is still bigger than on the previous version of Ubuntu though. I edited your answer because mentioned file is in a different location in Ubuntu 15.04.
-
alx.balmus about 9 yearsOne side effect of decreasing the timeout value is that the network manager indicator shows up while the login screen is displayed or if you login very fast it shows after you have logged in. This happened in Ubuntu 14.10 and older. This is just a "cosmetic" side effect. I have not found any functional unwanted side effects.
-
Tobu almost 9 yearsYou should use something like
systemctl edit NetworkManager-wait-online.service
or/etc/systemd/system/NetworkManager-wait-online.service.d/override.conf
, otherwise the changes won't persist. -
guntbert over 8 yearsWhy would that help?
-
WinEunuuchs2Unix almost 7 yearsThird one worked for me too with no ill-effects (so far).
-
Sandeep C over 6 yearsWhat is the use of this service?
-
Rochdi Boudjehem about 6 yearsThird one worked for me (18.04 upgraded from clean 17.10).
-
Rochdi Boudjehem about 6 yearsDidn't work for me, Instead of that disabling the service with
systemctl disable NetworkManager-wait-online.service
worked well. -
Mad Man almost 6 years#3 worked for me on 18.04.1, no issues after disabling.