You are not logged in.

#1 2011-01-07 23:18:43

aurocha
Member
Registered: 2009-11-16
Posts: 52

[SOLVED] Gnome: Udev+consolekit+udisks+policykit = Nightmare

Hi all,

Recently switched to Gnome - v 2.0.32. As it is announced that it no longer requires hal, I pacman -Rcsn hal.
Problem: usb external hard drive not mounting. Comes up with a "No authorization error".

Browsed the web, already was launching gnome as recomended (exec ck-launch-session gnome-session). The error persists.
Guess it is a consolekit problem, as announced somwhere in this forum, though Debian has this issue fixed (sid).

I don't use GDM to start X. Insted I launch it directly during the boot process, as refered in the wiki, which is great:

aurocha: ~ $ cat /etc/inittab | grep aurocha
# aurocha: Boot sem login manager, directamente para X
x:5:respawn:/bin/su aurocha -l -c "/bin/bash --login -c startx -- -nolisten tcp >/dev/null 2>&1"
aurocha: ~ $

As a temporary fix, I had to edit /usr/share/polkit-1/actions/:

aurocha: ~ $ ls /usr/share/polkit-1/actions/*udisk*
/usr/share/polkit-1/actions/org.freedesktop.udisks.policy
aurocha: ~ $ 

and change

 <action id="org.freedesktop.udisks.filesystem-mount">
(...)
from 
<allow_any>no</allow_any>
to
<allow_any>yes</allow_any>

Now it AUTOMOUNTS the partitions on the usb-hdd. That's NOT what I wanted, but for them to show up in Nautilus and mount them, as needed, as happens with the refered debian install, which, btw, resided on the external usb-hdd.

Any ideas?
I compared the above mentioned file to the one on the debian install and they are similar, so I'm guessing the problem resides on consolekit.
Any comments would be appreciated.

Regards,

- aurocha

Last edited by aurocha (2011-01-10 13:02:45)

Offline

#2 2011-01-08 18:25:54

thestinger
Package Maintainer (PM)
From: Toronto, Canada
Registered: 2010-01-23
Posts: 478

Re: [SOLVED] Gnome: Udev+consolekit+udisks+policykit = Nightmare

You aren't authorized by consolekit. You can see exactly what the problem is by running 'ck-list-sessions'. Only 'local' sessions are able to mount and shutdown, and to count as a local session you need to login via a tty or a display manager.

Read this page again and use the first method - the second will never work with consolekit without hacks that reduce security. You can switch the tty you're using to start X to mingetty and set it to autologin.

Your ~/.xinitrc should have 'exec ck-launch-session gnome-session' and you may need to uncomment the last line in /etc/pam.d/login.

# install consolekit and uncomment the line below
#   to have ACL handle non-standard udev permissions
session        optional    pam_ck_connector.so

You should also change back all the policy files to how they were before.

Last edited by thestinger (2011-01-08 18:29:41)

Offline

#3 2011-01-09 20:21:02

aurocha
Member
Registered: 2009-11-16
Posts: 52

Re: [SOLVED] Gnome: Udev+consolekit+udisks+policykit = Nightmare

Hi thestinger,

Thank you so much for your answer. I had downgraded to consolekit-0.4.1-4.
Here's what I did - I'm reproducing the steps for future reference too :-) :

- Compiled mingetty from AUR
- Edited /etc/inittab:

Boot from runlevel 5 - prefer it, so I can choose to boot to runlevel 3 if I need to:

## Only one of the following two lines can be uncommented!
# Boot to console
#id:3:initdefault:
# Boot to X11
id:5:initdefault:

Then the relevant part:

# c5:2345:respawn:/sbin/agetty -8 38400 tty5 linux
c5:2345:respawn:/sbin/mingetty --autologin aurocha tty5 linux

- Following your recomendation, re-read the link you left - Start X at boot
- Chose option #2:

/etc/.bash_profile:

. $HOME/.bashrc
if [[ -z "$DISPLAY" ]] && [[ ! -a "/tmp/.X11-unix/X0" ]] && [[ "`whoami`" != "root" ]]; then
  . startx
  logout
fi

- Removed consolekit from /etc/pacman.conf(IgnorePkg smile section and pacman -Syu'ed to get the latest consolekit - consolekit 0.4.2-1
- Uncommented session optional    pam_ck_connector.so in /etc/pam.d/login as recommended

Rebooted and everything is working fine now.
Here's the output of ck-list-sessions:

aurocha: ~ $ ck-list-sessions 
Session1:
    unix-user = '1000'
    realname = 'ARocha'
    seat = 'Seat1'
    session-type = ''
    active = FALSE
    x11-display = ''
    x11-display-device = ''
    display-device = '/dev/tty5'
    remote-host-name = ''
    is-local = TRUE
    on-since = '2011-01-09T20:00:14.871715Z'
    login-session-id = '4294967295'
    idle-since-hint = '2011-01-09T20:00:44.999989Z'
Session2:
    unix-user = '1000'
    realname = 'ARocha'
    seat = 'Seat1'
    session-type = ''
    active = TRUE
    x11-display = ':0'
    x11-display-device = '/dev/tty7'
    display-device = '/dev/tty5'
    remote-host-name = ''
    is-local = TRUE
    on-since = '2011-01-09T20:00:20.134521Z'
    login-session-id = '4294967295'

Should there be two sessions?
Anyway, everything is working now.

Thank you and regards,

- aurocha

Last edited by aurocha (2011-01-09 20:23:05)

Offline

#4 2011-01-10 01:36:14

thestinger
Package Maintainer (PM)
From: Toronto, Canada
Registered: 2010-01-23
Posts: 478

Re: [SOLVED] Gnome: Udev+consolekit+udisks+policykit = Nightmare

glad you got it to work big_smile

afaik it's normal to have the two sessions, the graphical session is separate from the console one, but it inherits the id of the console one

Offline

#5 2011-01-10 13:04:22

aurocha
Member
Registered: 2009-11-16
Posts: 52

Re: [SOLVED] Gnome: Udev+consolekit+udisks+policykit = Nightmare

Hi,

I'm marking this post as SOLVED.
Thank you once again for answering.

Regards,

- aurocha

Offline

#6 2011-01-18 21:55:57

qumran
Member
Registered: 2010-12-12
Posts: 3

Re: [SOLVED] Gnome: Udev+consolekit+udisks+policykit = Nightmare

Thank you! Had similiar problem and your answer solved it!

thestinger wrote:

You aren't authorized by consolekit. You can see exactly what the problem is by running 'ck-list-sessions'. Only 'local' sessions are able to mount and shutdown, and to count as a local session you need to login via a tty or a display manager.

Read this page again and use the first method - the second will never work with consolekit without hacks that reduce security. You can switch the tty you're using to start X to mingetty and set it to autologin.

Your ~/.xinitrc should have 'exec ck-launch-session gnome-session' and you may need to uncomment the last line in /etc/pam.d/login.

# install consolekit and uncomment the line below
#   to have ACL handle non-standard udev permissions
session        optional    pam_ck_connector.so

You should also change back all the policy files to how they were before.

Offline

Board footer

Powered by FluxBB