LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   I can't manage NetworkManager via /etc/rc.d/rc.networkmanager script (https://www.linuxquestions.org/questions/slackware-14/i-cant-manage-networkmanager-via-etc-rc-d-rc-networkmanager-script-4175625949/)

igadoter 03-20-2018 11:11 AM

I can't manage NetworkManager via /etc/rc.d/rc.networkmanager script
 
Hi, I got such error
Code:

root@darkstar:# /etc/rc.d/rc.networkmanager restart
Stopping NetworkManager: stopped
Starting NetworkManager daemon:  /usr/sbin/NetworkManager
root@darkstar:# nmcli -p g
Error: NetworkManager is not running.

any idea why this happens?

kjhambrick 03-20-2018 11:18 AM

igadoter --

I just now looked at my /var/log/messages file ( and dmesg too ) on Slackware64 Current and they're chock-full of NetworkManager entries.

Are there any interesting messages from NetworkManager in your /var/log/{messages,syslog} files ?

HTH.

-- kjh

igadoter 03-20-2018 01:43 PM

Thanks for reply. I found this in /var/log/messages
Code:

Mar 20 16:15:23 darkstar NetworkManager[1428]: <info>  [1521558923.3778] bus-manager:
could not connect to the system bus (Timeout was reached);
only the private D-Bus socket will be available

I am guessing that all tools to manage NetworkManager communicate with demon via D-Bus. But I still don't understand: the script works during system startup - because it is how NetworkManager is being run - simply by executing this script.

kjhambrick 03-20-2018 02:37 PM

igadoter --

What version of Slackware are you running ... and ... I assume it is a full install ?

-- kjh

igadoter 03-20-2018 03:14 PM

Sorry I should post this at beginning - 14.2 64 bit - full install with AlienBob multlib. But I never touched NetworkManager or anything related to D-Bus.

upnort 03-20-2018 03:29 PM

Quote:

I found this in /var/log/messages
The log message implies a permissions issue or perhaps a stale socket or pid file that needs to be deleted. Check /var/run/dbus. If d-bus is not running then the rc.networkmanager script should have spewed something about that ("D-BUS must be running to start NetworkManager"). Ensure rc.messagebus is executable. The rc.messagebus script supports a restart and reload option. Restart or reload and manually start rc.networkmanager. Check the output spew and logs thereafter.

You can manually start NM without the rc script, which would provide more output spew if using the --debug option.

Another thought: ensure /etc/rc.d/rc.inet1.conf is not configured -- empty entries and no gateway.

igadoter 03-20-2018 04:45 PM

Sorry for delay was little busy: restarting D-Bus simply killed SeaMonkey window. But it is true restarting D-Bus and then starting NetworkManager allows to connect to demon. But such solution seems to be disaster for many desktop applications like SeaMonkey I mentioned. So as now procedure should be to logout, then go to ttys login, and there from command line reactivate NetworkManager by stopping NetworkManager, restarting D-Bus and starting again NetworkManager. But this means that one cannot in real world manage NetworkManager via this script - it is simply far too complex. If I am right then this script should be removed. And as it is now - demon for NetworkManager - once started cannot be stopped.

upnort 03-20-2018 06:14 PM

Ensure rc.messagebus and rc.networkmanager are executable (chmod +x). Reboot.

FYI as English is not your native language: daemon rather than demon. :)

igadoter 03-20-2018 06:59 PM

Yes they both executable. What do you mean by reboot system? There is no need for reboot - I restarted NetworManager - it works - but for me the script /etc/rc.d/rc.networkmanager is not of much use - it seems tha one cannot restart MetworkManager by simply
Quote:

# /etc/rc.d/rc.networkmanager restart
Quote:

Originally Posted by upnort (Post 5833386)
FYI as English is not your native language: daemon rather than demon. :)

I prefer
Quote:

# kill demon
:)

Edit: maybe there is misunderstanding. I am not complaining that NetworkManager doesn't start or run. I complain that one cannot manage it via /etc/rc.d/rc.networkmanger script. Such command
Code:

# /etc/rc.d/rc.networkmanager restart
doesn't work as expected.

upnort 03-20-2018 07:33 PM

I suspect your system is not running correctly. A reboot often resolves such issues. Been there done that for more than 3 decades. :)

If you do not want to reboot then drop to run level 1 and then return to run level 3 or 4.

Close all apps. As root run init 1. Login as root and run init 3 or init 4.

igadoter 03-20-2018 07:55 PM

Quote:

Originally Posted by upnort (Post 5833415)

If you do not want to reboot then drop to run level 1 and then return to run level 3 or 4.

Close all apps. As root run init 1. Login as root and run init 3 or init 4.

Please @upnort be more specific. First the issue I am reporting exists quite a long time. So I think I rebooted computer dozen of times since I first noticed it. Reboot does not help. Did you tried the command
Code:

# /etc/rc.d/rc.networkmanager restart
on your own computer?

volkerdi 03-20-2018 09:27 PM

Quote:

Originally Posted by igadoter (Post 5833422)
Did you tried the command
Code:

# /etc/rc.d/rc.networkmanager restart
on your own computer?

Works fine here.

igadoter 03-20-2018 10:00 PM

For me also works fine here. I mean now it works fine. I just tried.

upnort 03-20-2018 10:20 PM

Quote:

Please @upnort be more specific.
Many people are loathe to reboot a computer to fix problems. uptime and all that. :D My suggestion to reboot was based on a hunch that somehow d-bus got mangled on your computer. Although possible to often fix things without rebooting, a reboot usually clears the slate to provide remedy.

Quote:

Did you tried the command
# /etc/rc.d/rc.networkmanager restart
on your own computer?
Works fine here.

At this point, if the problem persists and you have indeed rebooted many times without success, inspecting the logs is the only way others are going to be able to help.

One nice trick is to open a terminal window or console and use tail -f /var/log/messages to watch the log in real-time while restarting rc.networkmanager.

igadoter 03-20-2018 10:46 PM

Ok I don't like to feel stupid. This is pattern I repeated three times
Code:

1* boot the system
2* nmcli -p g          # it shows NetworkManager is running
3* /etc/rc.d/rc.networkmanager restart
4* nmlcli -p g        # now it shows Error: NetworkManager is not running
5* /etc/rc.d/rc.messagebus restart 
6* /etc/rc.d/rc.networkmanager restart
7* nmcli -p g          # it shows NetworkManager is running
8* /etc/rc.d/rc.networkmanager restart 
9* nmcli -p g          # again it shows NetworkManager is running

from now on I can repeat the steps 8* and 9* and result is the same. Conclusion is that
Code:

# /etc/rc.d/rc.networkmanager restart
fails only being issued the first time after the system boot.

Edit: now it seems for me that restarting D-Bus fixes the problem.


All times are GMT -5. The time now is 11:44 AM.