The issue is that sometimes after boot NetworkManager service is not running. It works fine to start it manually sudo service network-manager restart
or reboot the computer but since I want to access these computers remotely that's not always an option. Most times booting works fine (NetworkManager is running) so its hard to reproduce, say it only happens once every 20th boot.
I have seen this issue on two desktops running Ubuntu 20.04.2 LTS and kernel 5.10.25-051025
After it has happened I have tried to look through the journal but the only thing that stick out is this line
gnome-shell3166: JS ERROR: error initializing the NetworkManager Agent: NM.SecretAgentError: NetworkManager is not running
The computers are also running as NFS servers (if that could be related) and eth/network/interfaces looks like this
auto lo
iface lo inet loopback
Any ideas how I can determine the reason why NetworkManager is sometimes not running and how to ensure it is always running after boot (so I can access the computer remotely)?
Updates
Running status --full --no-pager network-manager
returns only this:
NetworkManager.service - Network Manager
Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:NetworkManager(8)
Found these lines in journalctl. can they be relevant?
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found ordering cycle on NetworkManager.service/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on basic.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on sockets.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on avahi-daemon.socket/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on sysinit.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on local-fs.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on mnt-NAS_data.mount/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on network.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Job NetworkManager.service/start deleted to break ordering cycle starting with network.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found ordering cycle on wpa_supplicant.service/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on basic.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on sockets.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on avahi-daemon.socket/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on sysinit.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on local-fs.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on mnt-NAS_data.mount/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on network.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Job wpa_supplicant.service/start deleted to break ordering cycle starting with network.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found ordering cycle on systemd-resolved.service/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on systemd-tmpfiles-setup.service/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on local-fs.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on mnt-NAS_data.mount/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Found dependency on network.target/start
dec 13 13:34:56 dataPC2 systemd[1]: network.target: Job systemd-resolved.service/start deleted to break ordering cycle starting with network.target/start
The mnt-NAS_data.mount is something we have created, could it disturb the network manager perhaps?
[Unit]
Description=NAS_2
After=network.target
[Mount]
What=/dev/disk/by-label/storage
Where=/mnt/NAS_data
Type=ext4
TimeoutSec=20
[Install]
WantedBy=multi-user.target