Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] KDE consolekit polkit: wrong policy and no session
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
rafspiny
n00b
n00b


Joined: 03 Mar 2015
Posts: 5
Location: Amsterdam

PostPosted: Tue Mar 03, 2015 9:54 pm    Post subject: [Solved] KDE consolekit polkit: wrong policy and no session Reply with quote

Hi guys,

I installed Gentoo last week, and after years that I haven't used. I love it! But unfortunately I encountered a few problems.
I emerged KDE (not from the overlay)
Code:

> kded4 --version
Qt: 4.8.5
KDE Development Platform: 4.14.3
KDE Daemon: 4.14.3


I tried my wifi, and it worked from command line using wpa_supplicant. But not from NetworkManager in KDE.
The error is
Quote:

no session found uid 1000


So I turn my attention to consolekit and polkit. Something was wrong.
Indeed no session was created after I login into KDE using KDM.

Code:

> ck-list-sessions
>


I had to change the policy file too. The one in /etc/dbus
Code:

<!DOCTYPE busconfig PUBLIC
 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
        <policy user="root">
                <allow own="org.freedesktop.NetworkManager"/>
                <allow send_destination="org.freedesktop.NetworkManager"/>

                <allow send_destination="org.freedesktop.NetworkManager"
                       send_interface="org.freedesktop.NetworkManager.PPP"/>

                <allow send_interface="org.freedesktop.NetworkManager.SecretAgent"/>

                <!-- Allow NM to talk to known VPN plugins; due to a bug in
                     the D-Bus daemon, when a plugin is installed and the user
                     immediately tries to use it, the VPN plugin's rules aren't
                     always loaded into dbus-daemon.  Those rules allow NM to
                     talk to the plugin.  Oops.  Work around that by explicitly
                     allowing NM to talk to VPN plugins here.
                  -->
                <allow send_destination="org.freedesktop.NetworkManager.openconnect"/>
                <allow send_destination="org.freedesktop.NetworkManager.openswan"/>
                <allow send_destination="org.freedesktop.NetworkManager.openvpn"/>
                <allow send_destination="org.freedesktop.NetworkManager.pptp"/>
                <allow send_destination="org.freedesktop.NetworkManager.vpnc"/>
                <allow send_destination="org.freedesktop.NetworkManager.ssh"/>
                <allow send_destination="org.freedesktop.NetworkManager.iodine"/>
        </policy>
        <policy context="default">
                <allow own="org.freedesktop.NetworkManager"/>
                <allow own="org.freedesktop.NetworkManagerSystemSettings"/>

                <allow send_destination="org.freedesktop.NetworkManager"/>
                <allow send_destination="org.freedesktop.NetworkManagerSystemSettings"/>

                <allow send_destination="org.freedesktop.NetworkManager"
                       send_interface="org.freedesktop.NetworkManager"
                       send_member="SetLogging"/>

                <allow send_destination="org.freedesktop.NetworkManager"
                       send_interface="org.freedesktop.NetworkManager"
                       send_member="Sleep"/>

                <allow send_destination="org.freedesktop.NetworkManager"
                       send_interface="org.freedesktop.NetworkManager"
                       send_member="sleep"/>

                <allow send_destination="org.freedesktop.NetworkManager"
                       send_interface="org.freedesktop.NetworkManager"
                       send_member="wake"/>

                <!-- The org.freedesktop.NetworkManagerSettings.Connection.Secrets
                     interface is secured via PolicyKit.
                  -->
        </policy>
        <policy group="plugdev">
                <allow send_destination="org.freedesktop.NetworkManager"/>
                <allow send_destination="org.freedesktop.NetworkManager"
                      send_interface="org.freedesktop.NetworkManager.PPP"/>
        </policy>
</busconfig>



I put yes to allow_any in the file /usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy

In order for the NetworkManager to work I have to run manually ck-launch-session and then restart teh NetworkManager service trough /etc/init.d/NetworkManager restart at every boot

Even my window filesystem weren't mounted automatically. I had to modify the /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy file
Code:

  <action id="org.freedesktop.udisks2.filesystem-mount">
    <description>Mount a filesystem</description>
    <description xml:lang="en_GB">Mount a filesystem</description>
    <description xml:lang="it">Monta un file system</description>
    <message>Authentication is required to mount the filesystem</message>
    <message xml:lang="en_GB">Authentication is required to mount the filesystem</message>
    <message xml:lang="it">È richiesto autenticarsi per montare il file system</message>
    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>


My user is the following groups:
Code:

> groups raffaele
wheel audio cdrom video cdrw usb messagebus plugdev sudo raffaele


But I have no idea on why there is no session. It seems that something is really wrong with the polkit configuration and dbus.
Apparently there is no error message in /var/log/messages. The only thing that seems to be close is
Quote:

IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
Mar 3 21:34:20 sunnydale NetworkManager[2024]: <info> (wlp2s0): supplicant interface state: disconnected -> i
nactive
Mar 3 21:34:20 sunnydale /etc/init.d/netmount[2206]: WARNING: netmount will start when NetworkManager has star
ted


Just for the sake of it, here is my make.conf file
Code:

# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-march=corei7-avx -Os -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
USE="aio aqua autoipd avahi bacula-nodir cleartype corefonts dbus dhclient ddate fat fontconfig g3dvl gimp git gnutls gudev hpn icu idn introspection jce kvm laptop lm_sensors logrotate mdnsresponder-compat mmx modemmanager msn ncurses netlink network-cron networkmanager nss ntp python raw smp sna sse sse2 sse4_1 ssse3 timezone urandom v4l vaapi wext wifi X xa Xorg xvmc zeroconf zip json zeroconf -R -acl -bluray -cdda -cddb -cdr -cracklib -dvd -eds -gdbm -gles -joystick -kerberos -ldap -nowlistening -oss -ppp -pulseaudio -semantic-desktop -bluetooth -connection-sharing -consolekit -dhcpcd -ppp -resolvconf (-selinux) -systemd -teamd -test -vala"
ABI_X86="64"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"
# Parrallel compilation
MAKEOPTS="-j2"
# Mirror
GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/"
# RSYNC SERVER
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"
# Other
INPUT_DEVICES="evdev mouse keyboard synaptics"
VIDEO_CARDS="intel i965"
LINGUAS="en_GB it"
source /var/lib/layman/make.conf



UPDATE: I am not able to connect trough a VPN. Debugging my connection i found out that:
Quote:

Mar 5 19:27:06 sunnydale NetworkManager[2763]: <debug> [1425583626.660617] [platform/nm-linux-platform.c:1950] event_notification(): netlink event (type 16) for link: ppp0 (3, family 0)
Mar 5 19:27:06 sunnydale NetworkManager[2763]: <debug> [1425583626.660697] [platform/nm-linux-platform.c:426] get_kernel_object(): get_kernel_object for link: ppp0 (3, family 0)
Mar 5 19:27:06 sunnydale NetworkManager[2763]: <debug> [1425583626.660729] [platform/nm-linux-platform.c:601] ethtool_get(): ethtool: Request failed: Operation not supported
Mar 5 19:27:06 sunnydale pppd[3824]: Using interface ppp0
Mar 5 19:27:06 sunnydale pppd[3824]: Connect: ppp0 <--> /dev/pts/3
Mar 5 19:27:06 sunnydale NetworkManager[2763]: <debug> [1425583626.663777] [platform/nm-linux-platform.c:4297] handle_udev_event(): UDEV event: action 'add' subsys 'net' device 'ppp0' (3); seqnum=1936
Mar 5 19:27:06 sunnydale NetworkManager[2763]: <debug> [1425583626.663844] [platform/nm-linux-platform.c:601] ethtool_get(): ethtool: Request failed: Operation not supported
Mar 5 19:27:06 sunnydale NetworkManager[2763]: <debug> [1425583626.663936] [platform/nm-linux-platform.c:601] ethtool_get(): ethtool: Request failed: Operation not supported
Mar 5 19:27:06 sunnydale NetworkManager[2763]: <debug> [1425583626.663992] [platform/nm-platform.c:2712] log_link(): signal: link added: 3: ppp0 <NOARP,DOWN> mtu 1500 unknown driver 'unknown' udi '/sys/devices/virtual/net/ppp0'


It seems like I have no permission to get the ppp0 device

Even tried to run pptp manually
Quote:

Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.763591] [platform/nm-linux-platform.c:601] ethtool_get(): ethtool: Request failed: Operation not supported
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.763698] [platform/nm-linux-platform.c:601] ethtool_get(): ethtool: Request failed: Operation not supported
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.763760] [platform/nm-platform.c:2712] log_link(): signal: link added: 9: ppp0 <NOARP,DOWN> mtu 1500 unknown driver 'unknown' udi '/sys/devices/virtual/net/ppp0'
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.763866] [devices/nm-device.c:8032] constructor(): [0xd4a940] (ppp0): constructor(): NMDeviceGeneric, kernel ifindex 9
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.763905] [platform/nm-linux-platform.c:601] ethtool_get(): ethtool: Request failed: Operation not supported
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.763936] [platform/nm-linux-platform.c:2542] supports_mii_carrier_detect(): SIOCGMIIPHY failed: 22
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.763957] [platform/nm-linux-platform.c:2559] supports_mii_carrier_detect(): MII not supported
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.763980] [devices/nm-device.c:7999] device_get_driver_info(): [0xd4a940] (ppp0): SIOCETHTOOL ioctl() failed: cmd=ETHTOOL_GDRVINFO, iface=ppp0, errno=95
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.764036] [platform/nm-linux-platform.c:601] ethtool_get(): ethtool: Request failed: Operation not supported
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.764098] [platform/nm-linux-platform.c:601] ethtool_get(): ethtool: Request failed: Operation not supported
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.764211] [platform/nm-linux-platform.c:2184] sysctl_get(): error reading /sys/class/net/ppp0/phys_port_id: Failed to read from file '/sys/class/net/ppp0/phys_port_id': Operation not supported
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <info> (ppp0): new Generic device (driver: 'unknown' ifindex: 9)
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <info> (ppp0): exported as /org/freedesktop/NetworkManager/Devices/6
Mar 5 20:27:13 sunnydale NetworkManager[2763]: <debug> [1425587233.764697] [nm-manager.c:1105] system_create_virtual_devices(): creating virtual devices...
Mar 5 20:27:13 sunnydale pptp[6115]: anon log[main:pptp.c:310]: The synchronous pptp option is NOT activated
Mar 5 20:27:14 sunnydale pppd[6114]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x67f89677> <pcomp> <accomp>]
Mar 5 20:27:17 sunnydale pppd[6114]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x67f89677> <pcomp> <accomp>]
Mar 5 20:27:20 sunnydale pppd[6114]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x67f89677> <pcomp> <accomp>]
Mar 5 20:27:23 sunnydale pppd[6114]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x67f89677> <pcomp> <accomp>]
Mar 5 20:27:26 sunnydale pppd[6114]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x67f89677> <pcomp> <accomp>]



And I am pretty sure I have every module I need, grepping ppp from lsmod gives:
Quote:

ppp_generic
ppp_mppe
ppp_async



Do you have any clue on this?

Thanks in advance.
Back to top
View user's profile Send private message
rafspiny
n00b
n00b


Joined: 03 Mar 2015
Posts: 5
Location: Amsterdam

PostPosted: Thu Mar 05, 2015 10:58 pm    Post subject: Reply with quote

I just noticed that in the make.conf there is a -consolekit..... I do not know when and how it ended up in the make.conf file.
Obviously now the permission problems are all solved.

If a moderator think there is now reason for this post to be left here, delete it.

Thanks
Back to top
View user's profile Send private message
martinlmccourt
n00b
n00b


Joined: 24 Jan 2015
Posts: 3

PostPosted: Tue Apr 14, 2015 10:17 am    Post subject: Reply with quote

Interesting so what do I do with this in my systemd setup?

Code:

# euse -E consolekit
*snip*
ERROR: Use flag "consolekit" is masked and should not be added to make.conf.
#
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum