15

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
        └─getty@tty1.service @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 systemd-rfkill@rfkill2.service
       421ms systemd-rfkill@rfkill0.service
       407ms media-TStore2.mount
       267ms gpu-manager.service
       215ms plymouth-read-write.service
       209ms systemd-rfkill@rfkill1.service
       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.

bubolex
  • 357

3 Answers3

16

I faced the same problem before, NetworkManager taking about 8 seconds. There are three ways to solve this problem:

  1. Disable connecting automatically for your connection

    edit connections > select your connection > edit and disable connecting automatically

    enter image description here

  2. You can simply disable Enable networking from network indicator.

  3. You can disable the service by running this command

    systemctl disable NetworkManager-wait-online.service
    
Zanna
  • 72,312
14

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.

Source

bubolex
  • 357
billgates
  • 156
4

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.

Peter
  • 1,688