Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] NetworkManager has to be started manually each time (Read 2977 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

[SOLVED] NetworkManager has to be started manually each time

I've been using Connman for managing networks on my laptop, but since I'll be needing to connect to an Eduroam network, which is very difficult to configure on Connman, I've switched to NetworkManager. However, I can't get it to start automatically, requiring me to run "sudo sv up NetworkManager" every time I boot up my computer.

I attempted to enable it with:
Code: [Select]
sudo ln -s /etc/runit/sv/NetworkManager /run/runit/service
Which is described on the wiki. What this does is enable me to type "NetworkManager" instead of having to type out the entire location when starting the service, but it still doesn't start automatically.

EDIT: Yes, I have installed "networkmanager-runit".

Re: NetworkManager has to be started manually each time

Reply #1
Did you remeber to disable/remove connmand from the runlevel? Post,

Code: [Select]
$ls -asl /run/runit/service/*

Runit should try to bring the service up once enabed. If it's not happening, check /var/log/*.log to see if you can find a clue. 
 

Re: NetworkManager has to be started manually each time

Reply #2
Did you remeber to disable/remove connmand from the runlevel? Post,

Code: [Select]
$ls -asl /run/runit/service/*

Runit should try to bring the service up once enabed.
Yes, I disabled Connmand.

Code: [Select]
laptop:[user]:~$ ls -asl /run/runit/service/*
0 lrwxrwxrwx 1 root root 19 26 dec  2020 /run/runit/service/acpid -> /etc/runit/sv/acpid
0 lrwxrwxrwx 1 root root 25  4 sep 17.06 /run/runit/service/agetty-tty1 -> /etc/runit/sv/agetty-tty1
0 lrwxrwxrwx 1 root root 25  4 sep 17.06 /run/runit/service/agetty-tty2 -> /etc/runit/sv/agetty-tty2
0 lrwxrwxrwx 1 root root 25  4 sep 17.06 /run/runit/service/agetty-tty3 -> /etc/runit/sv/agetty-tty3
0 lrwxrwxrwx 1 root root 25  4 sep 17.06 /run/runit/service/agetty-tty4 -> /etc/runit/sv/agetty-tty4
0 lrwxrwxrwx 1 root root 25  4 sep 17.06 /run/runit/service/agetty-tty5 -> /etc/runit/sv/agetty-tty5
0 lrwxrwxrwx 1 root root 25  4 sep 17.06 /run/runit/service/agetty-tty6 -> /etc/runit/sv/agetty-tty6
0 lrwxrwxrwx 1 root root 24 26 dec  2020 /run/runit/service/bluetoothd -> /etc/runit/sv/bluetoothd
0 lrwxrwxrwx 1 root root 20 26 dec  2020 /run/runit/service/cronie -> /etc/runit/sv/cronie
0 lrwxrwxrwx 1 root root 18 27 apr 14.58 /run/runit/service/dbus -> /etc/runit/sv/dbus
0 lrwxrwxrwx 1 root root 21 13 apr 22.26 /run/runit/service/elogind -> /etc/runit/sv/elogind
0 lrwxrwxrwx 1 root root 21 26 dec  2020 /run/runit/service/lightdm -> /etc/runit/sv/lightdm
0 lrwxrwxrwx 1 root root 18  5 may 22.20 /run/runit/service/lxdm -> /etc/runit/sv/lxdm
0 lrwxrwxrwx 1 root root 28 28 sep 17.30 /run/runit/service/NetworkManager -> /etc/runit/sv/NetworkManager
0 lrwxrwxrwx 1 root root 23 26 dec  2020 /run/runit/service/syslog-ng -> /etc/runit/sv/syslog-ng
0 lrwxrwxrwx 1 root root 19  4 sep 17.06 /run/runit/service/udevd -> /etc/runit/sv/udevd
laptop:[user]:~$
This log was taken right after boot, before I had manually started NetworkManager.
If it's not happening, check /var/log/*.log to see if you can find a clue. 
There's a lot of logs there, none of which are directly connected to NetworkManager or Runit. What should I look for?

 

Re: NetworkManager has to be started manually each time

Reply #3
After booting what is the output of:
- sv status NetworkManager
- ps -ef | grep NetworkManager

To check for a potential timing issue, what happens if you insert eg.
   sleep 10
before line
  exec NetworkManager -n > /dev/null 2>&1
in /etc/runit/sv/NetworkManager/run
and reboot

Re: NetworkManager has to be started manually each time

Reply #4
After booting what is the output of:
- sv status NetworkManager
- ps -ef | grep NetworkManager

To check for a potential timing issue, what happens if you insert eg.
   sleep 10
before line
  exec NetworkManager -n > /dev/null 2>&1
in /etc/runit/sv/NetworkManager/run
and reboot
Alright, I first tried out that sleep thing, and it did unfortunately not help. Just did what I expected and made it take longer to start NetworkManager manually.
Here's a log of me running those two commands right after booting.
Code: [Select]
laptop:[user]:~$ sudo sv status NetworkManager
[sudo] password for user:
down: NetworkManager: 77s
laptop:[user]:~$ sudo ps -ef | grep NetworkManager
root      1029   906  0 22:31 ?        00:00:00 runsv NetworkManager
user      1511  1452  0 22:33 pts/0    00:00:00 grep --colour=auto NetworkManager
laptop:[user]:~$

Re: NetworkManager has to be started manually each time

Reply #5
Alright, I first tried out that sleep thing, and it did unfortunately not help. Just did what I expected and made it take longer to start NetworkManager manually.
Here's a log of me running those two commands right after booting.
Code: [Select]
laptop:[user]:~$ sudo sv status NetworkManager
[sudo] password for user:
down: NetworkManager: 77s
laptop:[user]:~$ sudo ps -ef | grep NetworkManager
root      1029   906  0 22:31 ?        00:00:00 runsv NetworkManager
user      1511  1452  0 22:33 pts/0    00:00:00 grep --colour=auto NetworkManager
laptop:[user]:~$

As you can see, runit did try to bring the service up but NetworkManager failed to start. You need to look into logs to find out why it didn't come up.

Re: NetworkManager has to be started manually each time

Reply #6
I guess you typed wrong command to enable service

try this
sudo ln -s /etc/runit/sv/NetworkManager /run/runit/service/NetworkManager
Create problems which don't have solution


Re: NetworkManager has to be started manually each time

Reply #8
I guess you typed wrong command to enable service

try this
sudo ln -s /etc/runit/sv/NetworkManager /run/runit/service/NetworkManager
Alright dude, turns out that there was for whatever reason a file called "/run/runit/service/NetworkManager/down" which is how you disable a service, no idea why it was there. But after deleting it and rebooting everything works as it should, I guess the issue is solved now.