You are not logged in.

#1 2012-07-31 17:09:49

StR@ng3r
Member
Registered: 2011-11-12
Posts: 65

NetworkManager without ConsoleKit (possible?)

Hello there,

I am struggling to get NetworkManager working without consolekit since I have switched to systemd.

So far, after setting up systemd and recompiling polkit from ABS with the -systemd flag set, I "added session optional pam_systemd.so" to all relevant files in /etc/pam.d/ thus enabling systemd to divide user sessions into groups.

Once this was done, my nm-applet that didn't work at all before, now work to the extend that it is showing me all available wifi-network nearby. However, I am unable to connect to any. Once I click on a network, it tells me "Failed to activate connection" "(32) No session found for uid 1000 (Error statting file /var/run/ConsoleKit/database: No such file or directory)"

At that point I have been stuck for a while spending the past couple of days searching the internet for a (working) solution - with no luck. Does anyone of you happen to know how to solve this? I rly don't wonna install the depreciated ConsoleKit just to be able to manage wifi connections. sad


I'd switch to wicd but I need to be able to manage mobile broadband connections aswell and the only other option besides network manager to achieve that seems to be connman which doesn't have a working applet yet and can only be controlled by some test scripts...

Offline

#2 2012-07-31 19:07:29

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: NetworkManager without ConsoleKit (possible?)

StR@ng3r wrote:

I am struggling to get NetworkManager working without consolekit since I have switched to systemd.

Note that while this should be possible, it is not necessary, and ConsoleKit should still work.

I "added session optional pam_systemd.so" to all relevant files in /etc/pam.d/ thus enabling systemd to divide user sessions into groups.

This should not be neccessary, we should have added pam_systemd.so to all the relevant pam files in the repos (if not, please file bug reports).

Once this was done, my nm-applet that didn't work at all before, now work to the extend that it is showing me all available wifi-network nearby. However, I am unable to connect to any. Once I click on a network, it tells me "Failed to activate connection" "(32) No session found for uid 1000 (Error statting file /var/run/ConsoleKit/database: No such file or directory)"

Have you recompiled NetworkManager with systemd support? It needs to hook into either logind or ConsoleKit (default) to know that your session is the active one, to give you access to alter stuff like e.g. wireless connections.

--with-session-tracking=systemd

Offline

#3 2012-07-31 19:44:10

StR@ng3r
Member
Registered: 2011-11-12
Posts: 65

Re: NetworkManager without ConsoleKit (possible?)

Thank you. I was just about to post that the devs of NM have pointed me to compiling it with that flag as well. Guess that's what I am gonna do now.

Offline

#4 2012-08-06 04:05:21

StR@ng3r
Member
Registered: 2011-11-12
Posts: 65

Re: NetworkManager without ConsoleKit (possible?)

Ok, so I compiled networkmanager with the --with-session-tracking=systemd flag; however, it still does not work. When trying to add a wifi-connection I am being shown "error 32 - not authorized to control networking". My user has been added to the groups "wheel", "network" and "networkmanager". Any ideas? sad

Offline

#5 2012-08-11 19:22:09

Glaucous
Member
Registered: 2010-11-06
Posts: 41

Re: NetworkManager without ConsoleKit (possible?)

http://jeffhoogland.blogspot.se/2012/05 … cient.html

Did all you did and ended up with the same problem, this however solved it.

Offline

#6 2012-08-12 13:00:51

StR@ng3r
Member
Registered: 2011-11-12
Posts: 65

Re: NetworkManager without ConsoleKit (possible?)

Thank you. I had actually already tried that. However, it doesn't change a thing for me.

Could it be possible that the path has changed or something?

Is there a way to figure out where it fails? Like if this is a systemd issue, or something related to polkit or networkmanager?

Last edited by StR@ng3r (2012-08-12 13:15:42)

Offline

#7 2012-09-04 20:33:55

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: NetworkManager without ConsoleKit (possible?)

I'm having the same your problem @str@ng3r.
Did you managed to solve it? How?
I already rebuilt networkmanager from abs with no luck. The applet tells me "no network devices available"...
EDIT:

** (nm-applet:388): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: Rejected send message, 2 matched rules; type="method_call", sender=":1.29" (uid=1000 pid=388 comm="nm-applet ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination="org.freedesktop.NetworkManager" (uid=0 pid=378 comm="NetworkManager ")
** Message: applet now removed from the notification area
** Message: applet now embedded in the notification area

** (nm-applet:388): WARNING **: Failed to register as an agent: (32) Session not found
** Message: applet now removed from the notification area

That's the relevant part of the error when launching nm-applet .
EDIT2: i recompiled network-manager-applet too enabling systemd support (as i did with networkmanager), but it does not work, the error is the same as above.
I'm using both from testing (0.9.6).
EDIT3: nm-applet works perfectly if started from root.
This is my

cat /etc/polkit-1/localauthority/50-local.d/org.freedesktop.NetworkManager.pkla 

[nm-applet]
Identity=unix-group:network
Action=org.freedesktop.NetworkManager.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

(yes i added ResultInactive=yes too, but that doesn't solved the issue...). My user is in network group...

Last edited by nierro (2012-09-05 10:07:37)

Offline

#8 2012-09-06 12:13:31

czubek
Banned
Registered: 2012-03-08
Posts: 141

Re: NetworkManager without ConsoleKit (possible?)

I use Network Manager with NM-applet on openbox without consolekit. I think I am on full systemd, (don't really know for sure). Logged in as root all works fine. Logged in as user, the applet indicated no networks available yet I could still go online. Despite a nm-applet pkla file I had no rights. I found a temporary solution by inserting sudo before my nm-applet launcher in .config/openbox/autostart. I think polkit is the problem, because after removing consolekit I had to insert sudo before my systemctl reboot and systemctl poweroff commands in OBMenu. I enabled polkitd.service but still my elevated user rights are not being communicated to systemd.

Edit: corrected polkitd.system to polkitd.service

Last edited by czubek (2012-09-06 12:24:59)

Offline

#9 2012-09-06 12:58:57

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: NetworkManager without ConsoleKit (possible?)

Well, i did the same thing wink
I changed /etc/sudoers to make my user run sudo nm-applet without asking for a passwrod.
But then i found the solution: i was launching xfce4 through a .service that run "startxfce4". But there is no pam session created for my user in this way. I had to follow there: https://wiki.archlinux.org/index.php/Au … th_systemd . After enabling that, and changing my .bash_profile to make startx run when i'm autologged in tty1, everything works, without sudo.
To be sure, check "loginctl", it should say something like:

   SESSION        UID USER             SEAT            
         1       1000 federico         seat0           

1 sessions listed.

Otherwise you have no pam session created for your user.

Last edited by nierro (2012-09-06 12:59:32)

Offline

#10 2012-09-06 13:07:18

czubek
Banned
Registered: 2012-03-08
Posts: 141

Re: NetworkManager without ConsoleKit (possible?)

I think you're right nierro.

I found this discussion at this site that indicates the same "no pam session" problem.

http://archlinux.2023198.n4.nabble.com/ … 59502.html

I am below the level of noob so it will take me a little time to work through.

Thank you.

Offline

Board footer

Powered by FluxBB