Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] consolekit returns "active = FALSE"
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
hal2050
n00b
n00b


Joined: 19 Jul 2008
Posts: 47

PostPosted: Sun Jan 02, 2011 3:49 pm    Post subject: [solved] consolekit returns "active = FALSE" Reply with quote

hi all,

i'm referring to this bug report: https://bugs.gentoo.org/342291
i was told that my problem is not related to a bug of consolekit, but rather related to an invalid configuration. therefore i hope that anybody could point me into the right direction. :)
what i can tell is that everything used to work fine before upgrading to recent versions of relevant packages (please see 2.a).

###

0. the problem
ck-list-sessions returns:
Quote:
- active = FALSE
- is-local = FALSE
- login-session-id = ''


0.a the result:
it's not possible to reboot, shutdown, suspend the system or to automount removeable media (usb).

###

1. my system:
i'm running gentoo as a dedicated htpc system with plain xbmc on top of xorg. there's no de, dm or wm involved.

###

2. my setup:
2.a relevant packages:
Quote:
sys-auth/consolekit-0.4.2-r4 || \
sys-auth/consolekit-0.4.3 (USE="kernel_linux pam policykit")
sys-auth/pambase-20101024 (USE="consolekit cracklib minimal || -minimal sha512")
sys-apps/shadow-4.1.4.2-r6 (USE="cracklib nls pam")
sys-apps/dbus-1.4.0 (USE="null")


already re-emerged those with the --noconfmem parameter.

2.b kernel config
Quote:
grep -i CONFIG_AUDIT /usr/src/linux/.config
# CONFIG_AUDIT_ARCH is not set
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_WATCH=y
CONFIG_AUDIT_TREE=y
CONFIG_AUDIT_GENERIC=y


###

3. login and xorg / xbmc starting procedure
first of all i defined a global session to prevent users to alter or delete a .xinitrc file in their ~/ directory.

3.a cat /etc/env.d/90xsession
Code:
XSESSION="/usr/local/bin/xbmc-gentoo"


3.b cat /usr/local/bin/xbmc-gentoo
Code:
#!/bin/bash

/usr/bin/xsetbg -onroot -quiet -fullscreen -display :0
/home/xbmc/Media/Local/Pics/Wallpapers/xbmc_walls.jpg &
/usr/bin/xsetroot -cursor /opt/.modResources/xcursor/emptyCursor.xbm
/opt/.modResources/xcursor/emptyCursor.xbm &
/usr/local/bin/xbmc-wiiremote >/dev/null 2>&1 &

while true; do

    DISPLAY=:0.0 /usr/lib/xbmc/xbmc.bin --standalone --nolirc
    sleep 1

done


3.c cat /etc/conf.d/local
Code:
/usr/local/bin/xbmc-startx >/dev/null 2>&1 &


3.d cat /usr/local/bin/xbmc-startx
Code:
#!/bin/bash

USER="xbmc"
SHELL="/bin/bash"
CMD_SU="/bin/su"
ARGS_SU="$USER -s $SHELL -c -l"
CMD_X="/usr/bin/startx"
ARGS_X="vt7 -nolisten tcp -novtswitch +bs -nocursor -br -deferglyphs all -quiet
-allowMouseOpenFail"

while true; do

    $CMD_SU - $ARGS_SU "$CMD_X -- $ARGS_X"

done


4. result
4.a fresh boot
Code:
ck-list-sessions
Session1:
        unix-user = '1000'
        realname = '(null)'
        seat = 'Seat2'
        session-type = ''
        active = FALSE
        x11-display = ''
        x11-display-device = ''
        display-device = ''
        remote-host-name = ''
        is-local = FALSE
        on-since = '2010-12-07T18:52:47.915017Z'
        login-session-id = ''
Session2:
        unix-user = '1000'
        realname = '(null)'
        seat = 'Seat3'
        session-type = ''
        active = FALSE
        x11-display = ':0'
        x11-display-device = '/dev/tty7'
        display-device = ''
        remote-host-name = ''
        is-local = FALSE
        on-since = '2010-12-07T18:52:49.896551Z'
        login-session-id = ''
Session3:
        unix-user = '1000'
        realname = '(null)'
        seat = 'Seat4'
        session-type = ''
        active = FALSE
        x11-display = ''
        x11-display-device = ''
        display-device = '/dev/ssh'
        remote-host-name = 'buckaroo.ghostshell'
        is-local = FALSE
        on-since = '2010-12-07T18:53:11.844999Z'
        login-session-id = '1'


=> active/is-local = false
=> login-session-id gets only assigned to the remote ssh session

4.b /etc/init.d/local restart
Code:
ck-list-sessions
Session4:
        unix-user = '1000'
        realname = '(null)'
        seat = 'Seat5'
        session-type = ''
        active = FALSE
        x11-display = ''
        x11-display-device = ''
        display-device = ''
        remote-host-name = ''
        is-local = FALSE
        on-since = '2010-12-07T18:54:56.887529Z'
        login-session-id = '1'
Session5:
        unix-user = '1000'
        realname = '(null)'
        seat = 'Seat6'
        session-type = ''
        active = FALSE
        x11-display = ':0'
        x11-display-device = '/dev/tty7'
        display-device = ''
        remote-host-name = ''
        is-local = FALSE
        on-since = '2010-12-07T18:54:58.115872Z'
        login-session-id = '1'
Session3:
        unix-user = '1000'
        realname = '(null)'
        seat = 'Seat4'
        session-type = ''
        active = FALSE
        x11-display = ''
        x11-display-device = ''
        display-device = '/dev/ssh'
        remote-host-name = 'buckaroo.ghostshell'
        is-local = FALSE
        on-since = '2010-12-07T18:53:11.844999Z'
        login-session-id = '1'


=> active/is-local = false
=> login-session-id gets assigned

###

even if i execute startx manually i won't get active/is-local = true
this does also apply when i manually execute ck-launch-session:

Code:
Session7:
   unix-user = '1000'
   realname = '(null)'
   seat = 'Seat8'
   session-type = ''
   active = FALSE
   x11-display = ''
   x11-display-device = ''
   display-device = '/dev/pts/0'
   remote-host-name = ''
   is-local = FALSE
   on-since = '2011-01-02T15:40:40.608361Z'
   login-session-id = '3'


the difference is that i get a login-session-id.

###

according to the bug report something is screwed up in my login/autostart procedure.
what's your proposal to solve this issue and is there a better practice to autologin users and to autostart a session?

thanks in advance && regards,
hal2050


Last edited by hal2050 on Wed Jan 19, 2011 1:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
hal2050
n00b
n00b


Joined: 19 Jul 2008
Posts: 47

PostPosted: Tue Jan 04, 2011 11:53 am    Post subject: Reply with quote

anyone :?:
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Tue Jan 04, 2011 12:22 pm    Post subject: Reply with quote

hal2050 wrote:
anyone :?:

Don't nag.

Perhaps changing /etc/conf.d/local entry to
Code:
ck-launch-session /usr/local/bin/xbmc-startx >/dev/null 2>&1 &

will help.

But I think the problem lies in using 'su'.
Back to top
View user's profile Send private message
hal2050
n00b
n00b


Joined: 19 Jul 2008
Posts: 47

PostPosted: Tue Jan 04, 2011 12:54 pm    Post subject: Reply with quote

VoidMage wrote:
hal2050 wrote:
anyone :?:

Don't nag.

sorry for that. i was just curious that nobody responded yet, although there are a lot of people suffering this issue atm.

VoidMage wrote:
Perhaps changing /etc/conf.d/local entry to
Code:
ck-launch-session /usr/local/bin/xbmc-startx >/dev/null 2>&1 &

will help.

i tried that in the past already and it did not work. afaik ck-launch-session has to be run in conjunction with a session (openbox-session, gnome-session, etc.) but not with X directly.
nevertheless i tried your proposal again which results in the same described above.

VoidMage wrote:
But I think the problem lies in using 'su'.

so i disabled the entry in "conf.d/local" to execute startx manually as user without using su in first place. this leads to the same result described above.

edit:
for testing purposes i disabled the entry in "env.d/90xsession" and "conf.d/local". instead i created a .xinitrc in ~/.

Code:
cat .xinitrc
#!/bin/bash
exec ck-launch-session /usr/local/bin/xbmc-gentoo


result of "startx &":
Code:
ck-list-sessions
Session1:
   unix-user = '1000'
   realname = '(null)'
   seat = 'Seat2'
   session-type = ''
   active = FALSE
   x11-display = ''
   x11-display-device = ''
   display-device = '/dev/ssh'
   remote-host-name = 'buckaroo.ghostshell'
   is-local = FALSE
   on-since = '2011-01-04T13:13:07.679723Z'
   login-session-id = '1'
Session3:
   unix-user = '1000'
   realname = '(null)'
   seat = 'Seat4'
   session-type = ''
   active = FALSE
   x11-display = ':0'
   x11-display-device = '/dev/tty2'
   display-device = '/dev/pts/0'
   remote-host-name = ''
   is-local = FALSE
   on-since = '2011-01-04T13:15:02.656688Z'
   login-session-id = '1'


edit 2:
simply launching a plain session from console

Code:
ck-launch-session


results in

Code:
Session4:
   unix-user = '1000'
   realname = '(null)'
   seat = 'Seat5'
   session-type = ''
   active = FALSE
   x11-display = ''
   x11-display-device = ''
   display-device = '/dev/pts/0'
   remote-host-name = ''
   is-local = FALSE
   on-since = '2011-01-04T13:21:49.841513Z'
   login-session-id = '1'


, too.
Back to top
View user's profile Send private message
drinstant
n00b
n00b


Joined: 08 Apr 2010
Posts: 24

PostPosted: Tue Jan 18, 2011 10:41 am    Post subject: Reply with quote

same problem here.
Back to top
View user's profile Send private message
hal2050
n00b
n00b


Joined: 19 Jul 2008
Posts: 47

PostPosted: Tue Jan 18, 2011 10:53 am    Post subject: Reply with quote

unfortunately i didn't manage to get rid of my problem. :/
i triple-checked ssuominen's consolekit sticky (https://forums.gentoo.org/viewtopic-t-858965.html), and had about 99% of his hints in my system already. i'm rather clueless at this point.
Back to top
View user's profile Send private message
drinstant
n00b
n00b


Joined: 08 Apr 2010
Posts: 24

PostPosted: Tue Jan 18, 2011 11:15 am    Post subject: Reply with quote

I managed to get it working. I've also followed that guide without success, got fed up and simply re-emerged dbus dbus-glib pambase gvfs shadow udisks upower polkit with the --noconfmem flag. Then I noticed that consolekit wasn't explicitly emerged, so I re-emerged that one too, with the same flag. In the end, this did the trick. Geez. It already sucks to do revdep-rebuild all the time, but this kind of guesswork is really tedious.
Back to top
View user's profile Send private message
hal2050
n00b
n00b


Joined: 19 Jul 2008
Posts: 47

PostPosted: Tue Jan 18, 2011 11:26 am    Post subject: Reply with quote

ok, i've got no problem to re-emerge those packages again. :)

could you please check the list if there are any differences to yours? only difference i see is i don't use gvfs.

Code:
emerge -avq1 --noconfmem dbus dbus-glib pambase shadow udisks upower polkit consolekit
[ebuild   R   ] sys-apps/dbus-1.4.1  USE="X -debug -doc (-selinux) -static-libs -test"
[ebuild   R   ] dev-libs/dbus-glib-0.92  USE="bash-completion -debug -doc -static-libs -test"
[ebuild   R   ] sys-auth/polkit-0.99-r1  USE="nls pam -debug -doc -examples -gtk (-introspection)"
[ebuild   R   ] sys-auth/consolekit-0.4.3  USE="pam policykit -debug -doc -test"
[ebuild   R   ] sys-fs/udisks-1.0.2  USE="bash-completion nls -debug -doc -remote-access"
[ebuild   R   ] sys-power/upower-0.9.7  USE="ipod -debug -doc (-introspection)"
[ebuild   R   ] sys-auth/pambase-20101024  USE="consolekit cracklib minimal sha512 -debug -gnome-keyring -mktemp -pam_krb5 -pam_ssh -passwdqc (-selinux)"
[ebuild   R   ] sys-apps/shadow-4.1.4.2-r6  USE="cracklib nls pam -audit (-selinux) -skey"



edit:
i just gave it a shot but as expected it did not help. etc-update only listed "/etc/pam.d/system-login" which i overwrote.
Back to top
View user's profile Send private message
drinstant
n00b
n00b


Joined: 08 Apr 2010
Posts: 24

PostPosted: Tue Jan 18, 2011 2:24 pm    Post subject: Reply with quote

Here's what might be the problem: Start X from console with a simple startx as user. I suspect 'su' to be the culprit. I'll test that suspicion later on myself.
Back to top
View user's profile Send private message
hal2050
n00b
n00b


Joined: 19 Jul 2008
Posts: 47

PostPosted: Wed Jan 19, 2011 10:58 am    Post subject: Reply with quote

did you test it?

just asking because it didn't make any difference in my tests above. :/
Back to top
View user's profile Send private message
drinstant
n00b
n00b


Joined: 08 Apr 2010
Posts: 24

PostPosted: Wed Jan 19, 2011 11:40 am    Post subject: Reply with quote

yes, to me it made all the difference. I've got

su - instant -l -c 'exec startx -- vt7 >& ~/.xsession-errors' &

in my /etc/conf.d/local which seems to break consolekit. Manual startx works fine.
Back to top
View user's profile Send private message
hal2050
n00b
n00b


Joined: 19 Jul 2008
Posts: 47

PostPosted: Wed Jan 19, 2011 11:58 am    Post subject: Reply with quote

that's really strange.

did you execute "startx" locally or while you were on a ssh session?
i always tried this over a ssh session, because i'm using my system as an htpc. maybe it's worth a try to connect a keyboard...

but let's assume this would fix my problem. that leads me to another question. how would i then create some kind of autologin procedure without any dm?

edit:

ok here are some results:

note: consolekit is in the default runlevel.
local login at login prompt:

Code:
Session5:
   unix-user = '1000'
   realname = '(null)'
   seat = 'Seat1'
   session-type = ''
   active = TRUE
   x11-display = ''
   x11-display-device = ''
   display-device = '/dev/tty1'
   remote-host-name = ''
   is-local = TRUE
   on-since = '2011-01-19T12:44:04.066490Z'
   login-session-id = '4'
   idle-since-hint = '2011-01-19T12:44:44.010608Z'


well pretty promising. seems to make a real difference whether or not one starts X over ssh or locally.

firing startx while being logged in locally:
Code:
Session12:
   unix-user = '1000'
   realname = '(null)'
   seat = 'Seat1'
   session-type = ''
   active = TRUE
   x11-display = ':0'
   x11-display-device = '/dev/tty7'
   display-device = '/dev/tty1'
   remote-host-name = ''
   is-local = TRUE
   on-since = '2011-01-19T12:54:47.374403Z'
   login-session-id = '4'


heh. pretty nice. all is in state "true" now.

is it normal that my local shell session gets unactive after starting X?

Code:
Session13:
   unix-user = '1000'
   realname = '(null)'
   seat = 'Seat1'
   session-type = ''
   active = FALSE
   x11-display = ''
   x11-display-device = ''
   display-device = '/dev/tty1'
   remote-host-name = ''
   is-local = TRUE
   on-since = '2011-01-19T12:57:29.514985Z'
   login-session-id = '5'


after another research i found a wiki entry at archlinux describing that sudo and su do not work together with consolekit: https://wiki.archlinux.org/index.php/Start_X_at_Boot

i guess i'm going to open a new thread to find a solution for a autologin solution.

thanks for your help and hints drinstant!

CONCLUSION:
- sudo and su do not work together with consolekit
- consolekit does not work in case one opens a new session/xsession while being logged in remotely

cheers,
hal2050
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments 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