[SOLVED] Slackware 14.2, NetworkManager won't configure network until restarted
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Slackware 14.2, NetworkManager won't configure network until restarted
Hi,
The problem looks like that:
I boot my system and then loging into graphical session.
The first symptom is that NM applet does not show up on the panel.
The second is that the network connection is not configured.
This is true for both cable (Ethernet) and WiFi.
Then, I do: /etc/rc.d/rc.networkmanager restart and
the NM applet immediately shows up and the connection is being
established and properly configured in the end.
There is no problem between suspend and resume, the connection is
configured properly after the resume.
Unfortunately, I cannot say exactly when this behaviour started
to manifest itself, but I'm pretty sure the first time I encountered
it is after moving to new flat, i.e. different router and network.
Any ideas what might be wrong?
Thanks in advance!
--
Best regards,
Andrzej Telszewski
Last edited by atelszewski; 03-16-2018 at 06:06 PM.
Reason: Added the actual question ;-)
after moving to new flat, i.e. different router and network.
As you have moved recently, you might need to reconfigure NM. If you are using static IP addresses then NM needs to be reconfigured for the new address. If using DHCP but using a password, NM will not connect unless the password is correct.
My experience is any time NM encounters something not the same from the previous connection the software balks and pukes. I see this every time I toggle between home and work and between Ethernet and wireless -- NM gets confused as to which network to connect.
Watch the boot spew when NM launches. Also check /var/log/messages.
From a command line the nmcli command is helpful. For example, nmcli c will show connection information. Use the output of nmcli c to learn the possible connections and then use nmcli c up {name_of_connection} to connect. Using nmcli from the command line will expose error messages faster than sifting through logs.
Perhaps the network is being slow to respond to DHCP requests. You could consider trying ipv4.dhcp-timeout or ipv6.dhcp-timeout settings in /etc/NetworkManager/conf.d/00-dhcp-client.conf https://developer.gnome.org/NetworkM...ager.conf.html
1. I login into graphical session (as above) and nm-applet is not running
and network is not connected.
I execute nmcli c up CONNECTION_NAME and nm-applet shows up and
NetworkManager then connects fine.
2. I disable NetworkManager during boot (chmod -x /etc/rc.d/rc.networkmanager).
I login into graphical session, nm-applet is shown up as it should be and
correctly reports the NetworkManager is not running.
I start /etc/rc.d/rc.networkmanager and NetworkManager connects fine.
3. I enable NetworkManager during boot (chmod +x /etc/rc.d/rc.networkmanager). And here comes the solution: for the connections I set the "All users may connect to this network"
option and NetworkManager connects fine after reboot.
What a complete fuck up!
Why NM does not connect automatically when "All users may connect to this network" option
is not enabled, but still you can connect by restarting NM daemon or using nmcli.
It's beyond me.
Well, I'm software developer, so my mind can cope with it ;-)
Although it does not mean it should be this way ;-)
Thanks for the testing. I have wondered about the use of the "All users may connect to this network" option, but have never bothered to follow up.
Quote:
Why NM does not connect automatically when "All users may connect to this network" option
is not enabled, but still you can connect by restarting NM daemon or using nmcli.
Interesting. I suspect it is tied up with NetworkManager polkit permissions. https://people.freedesktop.org/~lkun...-examples.html
In /etc/rc.d/rc.M, rc.networkmanager is started before rc.consolekit.
So in your scenario 1 and 2, polkitd is running when NetworkManager is started.
In your scenario 3, polkitd is not running when NetworkManager is started.
Maybe some reordering in /etc/rc.d/rc.M is indicated.
Thanks for the testing. I have wondered about the use of the "All users may connect to this network" option, but have never bothered to follow up.
For me it's counter-intuitive madness.
It seems that, when you add connection, it is added with the permissions for the user that adds it.
And the user can edit the connection details.
But as soon as you turn on "All users may connect to this network" the user loses the permission to edit the connection.
Well, "All users may connect to this network" in that case definitely does not mean "All users may edit this connection" ;-)
I lost a bit of hair on that.
Quote:
Originally Posted by allend
In /etc/rc.d/rc.M, rc.networkmanager is started before rc.consolekit.
I played a bit with policykit today.
In my opinion, we have a Slackware bug here to be reported upstream ;-)
That is, consolekit should definitely run before NM.
I found also an interesting possibility.
If you want particular user(s) to be able to interact with NM with full privileges, add them to netdev group.
This works because of:
I found also an interesting possibility.
If you want particular user(s) to be able to interact with NM with full privileges, add them to netdev group.
If you add a user in Slackware using the "adduser" command, at some point it will tell you to "press arrow-up" to add a default set of recommended groups that the user should become member of. That group list is "audio cdrom floppy plugdev video power netdev lp scanner". Now why would that be ;-)
Just for kicks I reordered rc.M, putting rc.consolekit before rc.networkmanager,
just after rc.messagebus, so it also is just before rc.bluetooth (that was long ;-)).
I guess bluetooth might also make use of polkit.
Then I went to connection settings and disabled "All users may connect to this network".
And sure enough, as soon as I logged in into graphical session, the connection was established and
nm-applet was shown as it should be.
And now comes interesting fact.
Before logging into graphical session as the user, I first logged in on tty1 as root.
I checked ifconfig and the connection was NOT configured.
So we now have the explanation of "All users may connect to this network" ;-)
The user must login to have the connection activated.
We have a genuine bug here ;-)
Credits to @allend for pointing it out ;-)
Just for kicks I reordered rc.M, putting rc.consolekit before rc.networkmanager,
just after rc.messagebus, so it also is just before rc.bluetooth (that was long ;-)).
I guess bluetooth might also make use of polkit.
Then I went to connection settings and disabled "All users may connect to this network".
And sure enough, as soon as I logged in into graphical session, the connection was established and
nm-applet was shown as it should be.
And now comes interesting fact.
Before logging into graphical session as the user, I first logged in on tty1 as root.
I checked ifconfig and the connection was NOT configured.
So we now have the explanation of "All users may connect to this network" ;-)
The user must login to have the connection activated.
We have a genuine bug here ;-)
Credits to @allend for pointing it out ;-)
--
Best regards,
Andrzej Telszewski
What is the bug here?
If you select "All users may connect to this network" then the network configuration and a wireless password/passphrase is written in plaintext into the /etc/NetworkManager/system-connections/ directory with root-only access, and NetworkManager will be able to activate the network connection on boot - i.e. without anyone logging in.
If you do not select "All users may connect to this network" then the connection parameters including a wireless password/passphrase will be written into your user's profile and the password will be encrypted if you want, so that only you can access it. But in this case, the NetworkManager will not be able to activate the connection until after you login and run the NetworkManager client.
If you do not select "All users may connect to this network" then the connection parameters including a wireless password/passphrase will be written into your user's profile and the password will be encrypted if you want, so that only you can access it. But in this case, the NetworkManager will not be able to activate the connection until after you login and run the NetworkManager client.
The problem is that it wasn't working this way, as explained above.
It seems that consolekit has to run before NetworkManager for this schema to work.
The problem is that it wasn't working this way, as explained above.
It seems that consolekit has to run before NetworkManager for this schema to work.
--
Best regards,
Andrzej Telszewski
Yes, that might be necessary. To be frank, I always select "All users may connect to this network" to ensure that I have a working network before I login...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.