Can i disable NetworkManager-wait-online.service

grauda linux takes long to boot so when i try to see why this happens i found that NetworkManager-wait-online.service is too long
so can i disable it ?

Yes, you can.

However, any services or software that require a network connection to be active when they start may fail or not work as expected. Therefore, if you disable it make sure to remember that you made that change so you can revert it if necessary.

5 Likes

You might be better of masking it then boot will be fine and network manager should activate in its own time
sudo systemctl mask networkmanager

2 Likes

What exactly masking is?

Plug this into your search engine.

systemd masking
4 Likes

And this one is due :slight_smile:
https://wiki.archlinux.org/title/Systemd#Basic_systemctl_usage

4 Likes

Is there a reason to make it completely unusable (via mask) rather than just disabling it from starting on boot (via disable)?


Oh, also to note, even though NetworkManager-wait-online might be taking a long time to start (especially if you have a wifi connection that starts only after you log in) it does not necessarily mean that it is delaying your boot process. You should also check systemd-analyze critical-chain

5 Likes

What you guys would recommend me to do, should I disable/mask network manager?

If disabling network manager makes necessary files ( files important for os to function properly)
not to load then I will not try to disable or mask it

I was just trying to reduce boot time and saw that network manager taking 15s and thought to disable it if it make os unstable or not functioning properly then I will not do this

Check this, it could be that those 15s are in parallel with something else?
With regards to disable/mask, given the input above, I'd say: disable, but maybe someone knows better...

1 Like

It was my understanding that masking it does not stop it from starting it hides it from stopping the system from booting
try both methods its that simple and if it does not work change mask to unmask

No. Masking completely stops it from even manually started.

1 Like

I personally believe it is better to mask components such as Modem Manager and NetworkManager-wait-online.service if you don't want them to run.

To save a few seconds doesn't seem like a wise decision unless you know what you're doing. Some network components need to have a network connection up before they can be initiated.

Why are the young alwsys so concerned about a few seconds out of their lifetime. When I started using computers you could make your coffee and breakfast while waiting for your computer to boot.

Is Ritalin in such short supply these days that a couple of seconds is truly so important.

4 Likes

You made my day with this (sorry for the OT)

1 Like

and if you had to switch diskettes out, you also had time for a shower.

3 Likes

I remember two piles always on my desk, one for Windows (3.1?), one for Word.
BTW: Although floppy disks were slow, you had quick showers to switch them promptly :slight_smile:

3 Likes

output of systemd-analyze critical-chain

systemd-analyze critical-chain
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.

graphical.target @16.632s
└─multi-user.target @16.632s
└─whoogle.service @16.631s
└─network-online.target @16.630s
└─NetworkManager-wait-online.service @1.822s +14.807s
└─NetworkManager.service @1.701s +119ms
└─dbus.service @1.698s
└─basic.target @1.696s
└─sockets.target @1.696s
└─dbus.socket @1.696s
└─sysinit.target @1.694s
└─systemd-timesyncd.service @1.664s +29ms
└─systemd-tmpfiles-setup.service @1.530s +130ms
└─systemd-journal-flush.service @1.152s +377ms
└─var-log.mount @1.137s +10ms
└─[email protected]\x2duuid-9699b3da\x2d875a\x2d4507\x2d9cf0\x2da4a1b0dc3b>
└─local-fs-pre.target @1.121s
└─lvm2-monitor.service @280ms +840ms
└─systemd-journald.socket @276ms
└─system.slice @266ms
└─-.slice @266ms
lines 1-24/24 (END)

is 15s are in parallel with something else?

1 Like

More info on nm-wait-online if anyone wants to know

systemctl cat NetworkManager-wait-online.service
man nm-online
systemctl cat NetworkManager
man NetworkManager
3 Likes
sudo systemctl disable NetworkManager-wait-online

Reboot to test

1 Like

ok then i am disabling network manager

output

sudo systemctl disable NetworkManager-wait-online
Removed /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.

after disabling network manager

systemd-analyze critical-chain
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.

graphical.target @4.232s
└─multi-user.target @4.232s
└─systemd-swap.service @1.428s +2.804s
└─basic.target @1.403s
└─sockets.target @1.403s
└─dbus.socket @1.403s
└─sysinit.target @1.400s
└─systemd-timesyncd.service @1.365s +34ms
└─systemd-tmpfiles-setup.service @1.224s +138ms
└─systemd-journal-flush.service @1.108s +114ms
└─var-log.mount @1.095s +9ms
└─[email protected]\x2duuid-9699b3da\x2d875a\x2d4507\x2d9cf0\x2da4a1b0dc3b79.servi>
└─local-fs-pre.target @1.074s
└─lvm2-monitor.service @228ms +845ms
└─systemd-journald.socket @223ms
└─system.slice @211ms
└─-.slice @211ms
lines 1-20/20 (END)

output systemd-analyze blame after disabling network manager

ystemd-analyze blame
4.003s rtkit-daemon.service
2.804s systemd-swap.service
1.868s linux-modules-cleanup.service
845ms lvm2-monitor.service
354ms dev-sda2.device
289ms ananicy.service
285ms systemd-random-seed.service
214ms [email protected]
211ms plymouth-deactivate.service
205ms plymouth-quit-wait.service
205ms [email protected]
204ms plymouth-quit.service
194ms [email protected]
182ms [email protected]
171ms [email protected]
149ms upower.service
145ms polkit.service
138ms systemd-tmpfiles-setup.service
124ms NetworkManager.service
114ms systemd-journal-flush.service
113ms avahi-daemon.service
105ms plymouth-start.service
104ms ModemManager.service
94ms systemd-logind.service
93ms [email protected]
85ms systemd-guest-user.service
73ms systemd-udev-trigger.service
lines 1-27```