Force NetworkManager to restart and reload network drivers without a reboot

1

I have a recurring issues with NetworkManager and its dependent components that always fail when I don't have time to debug or fix the issue. I'm trying to figure-out how I can aggressively restart and unload / load both the kernel modules to restart NetworkManager. Think of it as soft reboot of your system, but without logging out. I have managed to do the same for bluetooth issues, e.g btuse and restart bluetoothd.

System i'm testing on: HW: Thinkpad T460 OS: Arch Linux Nic: Both WLAN and Nic Intel

So far I get the following issues:

kernel: NetworkManager  D    0 17671      1 0x00000004
kernel: Call Trace:
kernel:  __schedule+0x239/0x890
kernel:  schedule+0x3d/0x90
kernel:  schedule_preempt_disabled+0x15/0x20
kernel:  __mutex_lock.isra.2+0x295/0x520
kernel:  ? __follow_mount_rcu.isra.30+0x68/0xe0
kernel:  __mutex_lock_slowpath+0x13/0x20
kernel:  ? __mutex_lock_slowpath+0x13/0x20
kernel:  mutex_lock+0x25/0x30
kernel:  misc_open+0x28/0x170
kernel:  chrdev_open+0xa3/0x1c0
kernel:  do_dentry_open+0x1bc/0x2e0
kernel:  ? cdev_put.part.3+0x20/0x20
kernel:  vfs_open+0x4e/0x80
kernel:  path_openat+0x51e/0x13a0
kernel:  ? shmem_getpage_gfp+0xf2/0xbc0
kernel:  do_filp_open+0x9b/0x110
kernel:  ? __check_object_size+0xaf/0x1b0
kernel:  ? __alloc_fd+0xb2/0x160
kernel:  do_sys_open+0x1ba/0x250
kernel:  ? do_sys_open+0x1ba/0x250
kernel:  SyS_openat+0x14/0x20
kernel:  entry_SYSCALL_64_fastpath+0x1a/0xa5
kernel: RIP: 0033:0x7f2925471360
kernel: RSP: 002b:00007ffe2271fa50 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
kernel: RAX: ffffffffffffffda RBX: 000055fe3e292200 RCX: 00007f2925471360
kernel: RDX: 0000000000080002 RSI: 000055fe3c860343 RDI: ffffffffffffff9c
kernel: RBP: 00007f2925457240 R08: 0000000000000000 R09: 0000000000000000
kernel: R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
kernel: R13: 0000000000000000 R14: 0000000000000000 R15: 00007f2927e5fb68
kernel: NetworkManager  D    0 17797      1 0x00000004

Also the NetworkManger process's don't get properly purged, they still stay around as zombie process' which block the service restart

➜  ~ ps -A | grep Net
 2392 ?        00:00:00 NetworkManager
 2654 ?        00:00:00 NetworkManager
 2789 ?        00:00:00 NetworkManager
 2911 ?        00:00:00 NetworkManager
 3966 ?        00:00:00 NetworkManager
 4149 ?        00:00:00 NetworkManager
 4308 ?        00:00:00 NetworkManager
 4884 ?        00:00:00 NetworkManager
 5047 ?        00:00:00 NetworkManager
 5159 ?        00:00:00 NetworkManager
 5284 ?        00:00:00 NetworkManager
 5392 ?        00:00:00 NetworkManager
 5487 ?        00:00:00 NetworkManager
 5634 ?        00:00:00 NetworkManager
 5738 ?        00:00:00 NetworkManager
 5839 ?        00:00:00 NetworkManager
 6009 ?        00:00:00 NetworkManager
 6118 ?        00:00:00 NetworkManager
 6213 ?        00:00:00 NetworkManager
 6358 ?        00:00:00 NetworkManager
 6478 ?        00:00:00 NetworkManager
... many more

I can still get network access by setting the LAN and WLAN from the command line..

Any suggested would be great, even if the result is ugly it's fine. I rather the system reach a kernal panic then do anything at all. As currently the only other option is a restart.

linux
networking
arch-linux
kernel
systemd
asked on Super User Oct 20, 2017 by Darragh

1 Answer

0

If I understood correctly systemctl restart NetworkManager don't work and you need to reboot.

So, maybe I'm wrong but if it's really not "properly purged" it looks like you need a restart of systemd without a reboot ...

Don't know if it's the solution for your issue but to restart systemd without reboot you can execute (as root)

  • systemctl daemon-reexec

or alternatively

  • systemctl restart systemd-journald
answered on Super User Nov 5, 2017 by funilrys

User contributions licensed under CC BY-SA 3.0