I disabled NetworkManager-wait-online.service now i cant make it run at boot

inxi -b

System:
Host: greg-venusseries Kernel: 6.9.12-3-MANJARO arch: x86_64 bits: 64
Desktop: KDE Plasma v: 6.0.5 Distro: Manjaro Linux
Machine:
Type: Desktop System: Micro (HK) Tech product: Venus Series v: N/A
serial:
Mobo: Shenzhen Meigao Equipment model: AHWSA serial:
UEFI: American Megatrends LLC. v: AHWSA.1.22 date: 03/12/2024
CPU:
Info: 14-core (6-mt/8-st) 13th Gen Intel Core i9-13900H [MST AMCP]
speed (MHz): avg: 567 min/max: 400/5200:5400:4100
Graphics:
Device-1: Intel Raptor Lake-P [Iris Xe Graphics] driver: i915 v: kernel
Display: x11 server: X.Org v: 21.1.13 with: Xwayland v: 24.1.2 driver: X:
loaded: modesetting dri: iris gpu: i915 resolution: 3840x2160~60Hz
API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.1.6-arch1.1
renderer: Mesa Intel Graphics (RPL-P)
Network:
Device-1: Intel Ethernet I226-V driver: igc
Device-2: Intel Ethernet I226-LM driver: igc
Device-3: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
driver: mt7921e

I was trying to diagnose why i had a load of ordering cycle errors in my startup. GPT suggested i try disabling NetworkManager-wait-online.service but now, even though i enabled it, i can not get it to work at boot any more.

I have disabled all my samba automounts which did seem to be causing all the cycle errors but the NetworkManager-wait-online.service still failed to start at boot

❱sudo systemctl cat NetworkManager-wait-online.service
# /etc/systemd/system/NetworkManager-wait-online.service
[Unit]
Description=Network Manager Wait Online
Documentation=man:NetworkManager-wait-online.service(8)
Requires=NetworkManager.service
After=NetworkManager.service
Before=network-online.target

[Service]
# `nm-online -s` waits until the point when NetworkManager logs
# "startup complete". That is when startup actions are settled and
# devices and profiles reached a conclusive activated or deactivated
# state. It depends on which profiles are configured to autoconnect and
# also depends on profile settings like ipv4.may-fail/ipv6.may-fail,
# which affect when a profile is considered fully activated.
# Check NetworkManager logs to find out why wait-online takes a certain
# time.

Type=oneshot
ExecStart=/usr/bin/nm-online -s -q
RemainAfterExit=yes

# Set $NM_ONLINE_TIMEOUT variable for timeout in seconds.
# Edit with `systemctl edit NetworkManager-wait-online`.
#
# Note, this timeout should commonly not be reached. If your boot
# gets delayed too long, then the solution is usually not to decrease
# the timeout, but to fix your setup so that the connected state
# gets reached earlier.
Environment=NM_ONLINE_TIMEOUT=60

[Install]
WantedBy=network-online.target

No journalctl entries at all? It just is not even trying to start.

❱sudo journalctl -u NetworkManager-wait-online.service -b
-- No entries --

I can start the service, its status looks like after that

❱sudo systemctl start NetworkManager-wait-online.service

⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼ /home/greg ⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼
❱sudo systemctl status NetworkManager-wait-online.service
● NetworkManager-wait-online.service - Network Manager Wait Online
     Loaded: loaded (/etc/systemd/system/NetworkManager-wait-online.service; enabled; preset: disabled)
     Active: active (exited) since Mon 2024-09-02 20:24:51 BST; 3s ago
 Invocation: b2b2a01b4f9946969585077fd1d660c1
       Docs: man:NetworkManager-wait-online.service(8)
    Process: 6786 ExecStart=/usr/bin/nm-online -s -q (code=exited, status=0/SUCCESS)
   Main PID: 6786 (code=exited, status=0/SUCCESS)
   Mem peak: 2.6M
        CPU: 27ms

Sep 02 20:24:51 greg-venusseries systemd[1]: Starting Network Manager Wait Online...
Sep 02 20:24:51 greg-venusseries systemd[1]: Finished Network Manager Wait Online.

Not a lot thats relevant worry about in here

❱sudo journalctl -b -p 3
Sep 02 20:11:21 greg-venusseries kernel: pci 0000:00:07.2: DPC: RP PIO log size 0 is invalid
Sep 02 20:11:27 greg-venusseries wpa_supplicant[881]: bgscan simple: Failed to enable signal strength monitoring
Sep 02 20:12:23 greg-venusseries kernel: Bluetooth: hci0: command 0x0405 tx timeout
Sep 02 20:12:25 greg-venusseries kernel: Bluetooth: hci0: command 0x0405 tx timeout
Sep 02 20:13:02 greg-venusseries bluetoothd[785]: src/profile.c:record_cb() Unable to get Hands-Free Voice gateway SDP record: Connection timed out
Sep 02 20:13:02 greg-venusseries bluetoothd[785]: src/profile.c:record_cb() Unable to get Hands-Free Voice gateway SDP record: Connection timed out
Sep 02 20:13:02 greg-venusseries bluetoothd[785]: profiles/audio/avdtp.c:avdtp_connect_cb() connect to B0:38:E2:51:B0:B4: Connection reset by peer (104)
Sep 02 20:13:09 greg-venusseries bluetoothd[785]: profiles/audio/avdtp.c:avdtp_connect_cb() connect to B0:38:E2:51:B0:B4: Host is down (112)

But as soon as i reboot, it fails to load/start at all and leaves no entries in the logs? (it is enabled).

❱sudo systemctl status NetworkManager-wait-online.service
[sudo] password for greg: 
○ NetworkManager-wait-online.service - Network Manager Wait Online
     Loaded: loaded (/etc/systemd/system/NetworkManager-wait-online.service; enabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:NetworkManager-wait-online.service(8)
3

If you know how to disable a service, how do you not know how to enable it? Of course, just starting the service won’t make it run again at boot.

no but enabling it will and thats what iv have. Its enabled.

Something is wrong here. Why does that file exist? What did you do? This is what it should look like:

❯ systemctl status NetworkManager-wait-online.service
● NetworkManager-wait-online.service - Network Manager Wait Online
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager-wait-online.service; enabled; preset: disabled)
     Active: active (exited) since Mon 2024-09-02 10:39:08 MDT; 3h 14min ago
 Invocation: a85d8ffaf84a4ab29e4bf4b381f064a7
       Docs: man:NetworkManager-wait-online.service(8)
    Process: 1029 ExecStart=/usr/bin/nm-online -s -q (code=exited, status=0/SUCCESS)
   Main PID: 1029 (code=exited, status=0/SUCCESS)
   Mem peak: 2.3M
        CPU: 28ms

Sep 02 10:39:01 gazelle systemd[1]: Starting Network Manager Wait Online...
Sep 02 10:39:08 gazelle systemd[1]: Finished Network Manager Wait Online.
1 Like

Hi,

Now thats a very good question. I have no clue. all i did was disable the service reboot and see it was not helping with my original problems and so i just enabled it again.

I have just searched my history for all commands issued today with the term “NetworkManager-wait-online”

09/02/24 21:02  history --merge; history search --show-time="%D %H:%M  " NetworkManager-wait-online
09/02/24 20:24  sudo systemctl status NetworkManager-wait-online.service
09/02/24 20:24  sudo systemctl start NetworkManager-wait-online.service
09/02/24 20:24  sudo journalctl -u NetworkManager-wait-online.service -b | grep wait-online
09/02/24 20:23  sudo journalctl -u NetworkManager-wait-online.service -b
09/02/24 20:21  sudo systemctl cat NetworkManager-wait-online.service
09/02/24 20:09  sudo systemctl enable NetworkManager-wait-online.service
09/02/24 20:08  sudo journalctl -b -u NetworkManager-wait-online.service
09/02/24 20:03  sudo journalctl -xe -u NetworkManager-wait-online.service
09/02/24 20:02  sudo systemctl edit --full NetworkManager-wait-online.service
09/02/24 19:54  sudo systemctl restart NetworkManager-wait-online.service
09/02/24 19:13  sudo systemctl unmask NetworkManager-wait-online.service
09/02/24 19:03  sudo systemctl reenable NetworkManager-wait-online.service
09/02/24 18:59  sudo systemctl list-dependencies NetworkManager-wait-online.service
09/02/24 18:44  sudo journalctl -b -u NetworkManager-wait-online
09/02/24 18:43  sudo journelctl -b -u NetworkManager-wait-online
09/02/24 18:32  sudo systemctl disable NetworkManager-wait-online.service

I honestly don’t think i moved anything :scratches head:

What should i do, move it? re-install networkmanager? hmm

This did it.
Created /etc/systemd/system/NetworkManager-wait-online.service I mean.

Just delete your custom file.

sudo rm /etc/systemd/system/NetworkManager-wait-online.service
3 Likes

O, you better explain exactly how as iv only just figure that i can use edit --full and if its got something that important that i should know then i’d love to know.

I do have all the files in /usr/lib/systemd/system but i also have these in /etc/systemd/system

Most are mine, some need cleaning up. Heres a ls of them just in case its of help to you.

❱lll /etc/systemd/system
Permissions Size User Group Date Modified Date Created Name
drwxr-xr-x     - root root   2 Sep 20:03  12 Jul 17:53  .
drwxr-xr-x     - root root   2 Sep 09:34  12 Jul 17:53  ..
drwxr-xr-x     - root root  12 Jul 17:54  12 Jul 17:54  bluetooth.target.wants
drwxr-xr-x     - root root   2 Jul 04:23  12 Jul 17:53  getty.target.wants
drwxr-xr-x     - root root   2 Sep 19:48  12 Jul 17:53  multi-user.target.wants
drwxr-xr-x     - root root   2 Sep 19:03   2 Sep 19:03  network-online.target.wants
drwxr-xr-x     - root root   2 Sep 18:23   2 Sep 17:21  NetworkManager.service.d
drwxr-xr-x     - root root  12 Jul 17:54  12 Jul 17:54  printer.target.wants
drwxr-xr-x     - root root   1 Aug 13:59  12 Jul 17:53  sockets.target.wants
drwxr-xr-x     - root root  12 Jul 17:54  12 Jul 17:54  sysinit.target.wants
drwxr-xr-x     - root root  21 Aug 11:09  12 Jul 17:53  timers.target.wants
.rw-r--r--   241 root root  21 Aug 11:02  21 Aug 11:02  btrfs-backup-to-ssd.service
.rw-r--r--   158 root root  26 Aug 21:29  21 Aug 11:05  btrfs-backup-to-ssd.timer
.rw-r--r--   157 root root  21 Aug 14:24  21 Aug 14:24  check_bluetooth.service
.rw-r--r--   154 root root   2 Sep 17:55   2 Sep 17:55  check_bluetooth.timer
lrwxrwxrwx     - root root  12 Jul 17:54  12 Jul 17:54  dbus-org.bluez.service -> /usr/lib/systemd/system/bluetooth.service
lrwxrwxrwx     - root root  12 Jul 17:54  12 Jul 17:54  dbus-org.freedesktop.ModemManager1.service -> /usr/lib/systemd/system/ModemManager.service
lrwxrwxrwx     - root root   2 Sep 19:01   2 Sep 19:01  dbus-org.freedesktop.nm-dispatcher.service -> /usr/lib/systemd/system/NetworkManager-dispatcher.service
lrwxrwxrwx     - root root  12 Jul 17:54  12 Jul 17:54  dbus-org.freedesktop.timesync1.service -> /usr/lib/systemd/system/systemd-timesyncd.service
lrwxrwxrwx     - root root  12 Jul 17:54  12 Jul 17:54  display-manager.service -> /usr/lib/systemd/system/sddm.service
.rw-r--r--   215 root root  19 Aug 00:30   2 Sep 19:20  mnt-TRUENAS_cavern.automount
.rw-r--r--   351 root root  18 Aug 17:14  18 Aug 17:14  mnt-TRUENAS_cavern.mount
.rw-r--r--   203 root root   2 Sep 19:26   2 Sep 19:25  mnt-TRUENAS_home.automount
.rw-r--r--   346 root root  18 Aug 17:17  18 Aug 17:17  mnt-TRUENAS_home.mount
.rw-r--r--   207 root root  19 Aug 00:25  18 Aug 18:24  mnt-TRUENAS_mandie.automount
.rw-r--r--   354 root root  18 Aug 17:29  18 Aug 17:29  mnt-TRUENAS_mandie.mount
.rw-r--r--   219 root root  19 Aug 00:31  18 Aug 18:07  mnt-TRUENAS_manjaro_home.automount
.rw-r--r--   367 root root  18 Aug 17:04  18 Aug 17:04  mnt-TRUENAS_manjaro_home.mount
.rw-r--r--   205 root root  19 Aug 00:31  18 Aug 18:21  mnt-TRUENAS_media.automount
.rw-r--r--   350 root root  18 Aug 17:26  18 Aug 17:19  mnt-TRUENAS_media.mount
.rw-r--r--  1.2k root root  10 Aug 00:29   2 Sep 20:02  NetworkManager-wait-online.service

What do you mean?

You run that command - it creates the file in /etc/* for you to edit.
Which is intended to augment the existing /usr/lib/systemd/system/NetworkManager-wait-online.service which you should not edit by hand.

O, i thought that edit was to create a drop-in, and --full was to edit the actual unit file rather than having to get it path and then sudo micro path

However, you know what they say about assumption ^^

Thank you very much :slight_smile:

What else do i need to do?

I deleted the other one, i have disabled then re enabled the proper one, stopped and started it but it still says this for the status after boot

❱sudo systemctl status NetworkManager-wait-online.service
[sudo] password for greg: 
○ NetworkManager-wait-online.service - Network Manager Wait Online
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager-wait-online.service; enabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:NetworkManager-wait-online.service(8)
3

no logs

⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼ /home/greg ⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼
❱sudo journalctl -u NetworkManager-wait-online.service -b 
-- No entries --

The issue this topic is about has been solved and is now closed.

Create a new topic about the actual problem you were having to begin with instead of an issue you had with the imagined (or hallucinated by useless AI) solution. That’s the definition of an XY Problem. :wink:

2 Likes