NetworkManager-wait-online.service slow boot times

Hello,
Since I added a new network card (Intel Corporation Centrino Ultimate-N 6300) in my thinkpad x230 I started having 2min + boots (although sometimes its faster if the laptop manages to have a connection).

Here is some logs that might be useful:

When I run systemd-analyze:

Startup finished in 2.630s (kernel) + 17.928s (initrd) + 2min 10.419s (userspace) = 2min 30.978s 

When I run systemd-analyze critical-chain:

graphical.target @2min 10.395s
└─multi-user.target @2min 10.394s
  └─plymouth-quit-wait.service @2min 6.071s +4.317s
    └─systemd-user-sessions.service @2min 5.769s +22ms
      └─remote-fs.target @2min 5.761s
        └─remote-fs-pre.target @2min 5.761s
          └─nfs-client.target @6.139s
            └─gssproxy.service @6.111s +27ms
              └─network.target @6.100s
                └─wpa_supplicant.service @6.079s +19ms
                  └─dbus-broker.service @4.071s +114ms
                    └─dbus.socket @3.964s
                      └─sysinit.target @3.952s
                        └─systemd-update-utmp.service @3.929s +22ms
                          └─auditd.service @3.846s +80ms
                            └─systemd-tmpfiles-setup.service @3.739s +102ms
                              └─local-fs.target @3.632s
                                └─home.mount @3.621s +9ms
                                  └─systemd-fsck@dev-mapper-fedora_localho>
                                    └─local-fs-pre.target @3.574s
                                      └─lvm2-monitor.service @1.294s +1.51>
                                        └─dm-event.socket @1.267s
                                          └─system.slice
                                            └─-.slice

The issue seems to be coming from the NetworkManager-wait-online.service.

After boot I can start it normally, so I’m not sure why is it failing on boot.

Also sometimes it does not fail but I still get wait times. Is there a way to check which services are depended on it?

For now I put a 1 second timeout to the service’s file but it does not seem to work.
My next step is probably going to be to mask the service but ideally I would like to solve the issue and not try to hide it.

Does any of you have a similar issue?

edit: Does anyone know why fedora needs to establish a connection on boot? I would imagine that this can also happen in the login screen?

1 Like

I had this in libvirt when I started a VM. Afterwards I had no network connection. Unfortunately I not found out how to debug. But since I avoid virtual “machine manager” to manage the a virtual network i have peace. I do use a bridged connection created with nmcli

man NetworkManager-wait-online.service explains what this is, and why it can take so long, and what to do about it.

To see what units Requires or Wants netork online, run this command

systemctl list-dependencies --reverse network-online.target

The following command shows the units that directly or indirectly is wanted or required by network-onlyne.target

systemctl list-dependencies  network-online.target
2 Likes

This is showing that the delay is waiting on mounting of remote file systems. In fact remote-fs.target depends upon remote-fs.target.wants/var-lib-machines.mount and will wait until that fails or succeeds before continuing.

Are you mounting an nfs file system or other file system during boot?

1 Like

not willingly. Is this something that comes by default with fedora?

1 Like

is there a recommended way to disable them completely?

1 Like

Can you give the output of cat /etc/fstaband mount?

Generally speaking, if you have a reboot filesystem like nfs, cifs, iscsi, etc. in fstab, you might set the _netdev option so that it doesn’t block boot up on waiting for a connection.

1 Like

fstab result:

#
# /etc/fstab
# Created by anaconda on Tue May 22 16:59:54 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/fedora_localhost--live-root /                       ext4    defaults,x-systemd.device-timeout=0 1 1
UUID=b1713c15b-acd3-1723-c5a1-5dda6b138b13 /boot                   ext4    defaults        1 2
/dev/mapper/fedora_localhost--live-home /home                   ext4    defaults,x-systemd.device-timeout=0 1 2
/dev/mapper/fedora_localhost--live-swap swap                    swap    defaults,x-systemd.device-timeout=0 0 0

mount result:

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=1048576,mode=755,inode64)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,size=736952k,nr_inodes=819200,mode=755,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,seclabel,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime,seclabel)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
/dev/mapper/fedora_localhost--live-root on / type ext4 (rw,relatime,seclabel)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,nosuid,noexec,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14718)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime,seclabel)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime,seclabel)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime,seclabel)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,seclabel,nr_inodes=1048576,inode64)
/dev/sda1 on /boot type ext4 (rw,relatime,seclabel)
/dev/mapper/fedora_localhost--live-home on /home type ext4 (rw,relatime,seclabel)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=368476k,nr_inodes=92119,mode=700,uid=1000,gid=1000,inode64)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)