[ConsoleKit] Problems implementing ConsoleKit support in Xfce

Jannis Pohlmann jannis at xfce.org
Thu Sep 9 04:11:41 PDT 2010


Hey everyone,

at Xfce we're aiming at supporting ConsoleKit in our next stable
release. We've encountered a few problems with that however, so I'd be
very happy if someone could help us out.

First, let me outline our current implementation in brief. 

Our session manager "xfce4-session", when started, checks whether
XDG_SESSION_COOKIE is set. If it is, it simply starts up, leaving the
environment variable as it is. If it's not set yet, it calls
org.freedesktop.ConsoleKit.Manager.OpenSession() to become the leader
of a new session. It then sets XDG_SESSION_COOKIE itself.

xfce4-session is launched from a startup script called "startxfce4".
This bash script simply calls "xfce4-session".

Now we are facing two different setups: some users use a login manager
like GDM whereas others are running Xfce manually. In both cases,
startxfce4 is the entry point from where xfce4-session is launched.
This is where our implementation seems to be broken.

Starting Xfce from within GDM works fine. xfce4-session doesn't touch
the session cookie and instead becomes a normal session daemon or
session application (I'm citing the usage patterns from the ConsoleKit
documentation here). 

When starting Xfce manually via startxfce4, the same happens but things
like shutdown/restart and mounting/unmounting devices can no longer be
performed by the user. Now if we launch xfce4-session with
"ck-launch-session xfce4-session" it works fine (although some people
have suggested to use "ck-launch-session dbus-launch --sh-syntax
--exit-with-session xfce4-session" instead).

I took a quick look at ck-launch-session and it doesn't do much aside
from calling org.freedesktop.ConsoleKit.Manager.OpenSession() through
CkConnector. 

Now I'm wondering... should we always open a new session or should we
try to reuse the existing session? Or are there certain conditions under
which we should not reuse existing sessions (e.g. x11-display not
set) and others under which we should reuse (like with GDM)? Is using
ck-launch-session a good idea or should all this be handled via D-Bus
calls within our session manager? 

As you can see, I'm quite confused. So far, none of the solutions we've
come up with seem like a sane choice, so I'd be very, very happy if
someone could give us a hint into the right direction by telling us
what we're doing wrong and what we could do better.

Cheers,
Jannis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/consolekit/attachments/20100909/51065249/attachment.pgp>


More information about the ConsoleKit mailing list