LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-16-2018, 06:00 PM   #1
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Rep: Reputation: Disabled
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 ;-)
 
Old 03-16-2018, 06:38 PM   #2
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Quote:
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.
 
1 members found this post helpful.
Old 03-16-2018, 07:26 PM   #3
Skaendo
Senior Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 1,445

Rep: Reputation: Disabled
I am seeing the same thing you are atelszewski.

I am also seeing similar issues on fresh installs -current.
 
Old 03-16-2018, 09:06 PM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,376

Rep: Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756
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
 
Old 03-17-2018, 12:26 AM   #5
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Original Poster
Rep: Reputation: Disabled
Hi,

Here comes some more debugging.

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 ;-)

--
Best regards,
Andrzej Telszewski
 
Old 03-17-2018, 09:24 AM   #6
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,376

Rep: Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756
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.
 
Old 03-17-2018, 09:53 AM   #7
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Original Poster
Rep: Reputation: Disabled
Hi,

Quote:
Originally Posted by allend View Post
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 View Post
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:
Code:
$ cat /etc/polkit-1/rules.d/10-org.freedesktop.NetworkManager.rules 
polkit.addRule(function(action, subject) {
  if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && 
      subject.isInGroup("netdev")) {
      return polkit.Result.YES;
  }
});
--
Best regards,
Andrzej Telszewski
 
Old 03-17-2018, 12:09 PM   #8
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by atelszewski View Post
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 ;-)
 
Old 03-17-2018, 03:06 PM   #9
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Original Poster
Rep: Reputation: Disabled
Hi,

Well, when adding a user, a type a name and then keep pressed enter key till the end ;-)

--
Best regards,
Andrzej Telszewski
 
Old 03-17-2018, 05:00 PM   #10
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Original Poster
Rep: Reputation: Disabled
Hi,

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
 
Old 03-17-2018, 05:56 PM   #11
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by atelszewski View Post
Hi,

Well, when adding a user, a type a name and then keep pressed enter key till the end ;-)

--
Best regards,
Andrzej Telszewski
Well that's just being ignorant, pardon my words.
 
1 members found this post helpful.
Old 03-17-2018, 06:00 PM   #12
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by atelszewski View Post
Hi,

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.
 
1 members found this post helpful.
Old 03-17-2018, 06:02 PM   #13
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Original Poster
Rep: Reputation: Disabled
Hi,

Quote:
Originally Posted by Alien Bob View Post
Well that's just being ignorant, pardon my words.
OK, for the broader understanding, I don't do it like that ;-)

I just couldn't resist having an analogy of installing Windows.
You insert the CD and then place a brick on the return key.

--
Best regards,
Andrzej Telszewski
 
Old 03-17-2018, 06:05 PM   #14
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Original Poster
Rep: Reputation: Disabled
Hi,

Quote:
Originally Posted by Alien Bob View Post
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.

--
Best regards,
Andrzej Telszewski
 
Old 03-17-2018, 06:11 PM   #15
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by atelszewski View Post
Hi,

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...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wirless Disconnects/Won't Connect till OS is restarted sjahed Linux - Networking 2 09-18-2014 06:17 PM
[SOLVED] Ubuntu 9.04 Network manager won't re-enable eth0 if router restarted NightHorse Linux - Newbie 17 07-29-2009 11:16 PM
how to configure my network on slackware 10.0 so i can access a windows network salviadud Linux - Newbie 2 02-11-2005 01:19 PM
Slackware 10.0 X server --can't configure, won't load endersdouble Slackware 5 10-09-2004 03:49 PM
Network devices won't configure after apt-get upgrade BertBert Linux - Networking 1 05-24-2004 11:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration