After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 368704 - ConsoleKit support
ConsoleKit support
Status: RESOLVED OBSOLETE
Product: fast-user-switch-applet
Classification: Deprecated
Component: Applet
Trunk
Other Linux
: Normal normal
: ---
Assigned To: Fast User Switch Applet Maintainer
Fast User Switch Applet Maintainer
: 323954 (view as bug list)
Depends on:
Blocks: 172912
 
 
Reported: 2006-11-01 04:42 UTC by William Jon McCann
Modified: 2011-03-20 04:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description William Jon McCann 2006-11-01 04:42:26 UTC
GDM in CVS HEAD now has ConsoleKit <http://gitweb.freedesktop.org/?p=ConsoleKit.git;a=summary>
support.

It would be nice to think about how this can benefit FUSA.  The way I see it working is that FUSA can first ask ConsoleKit what session it is running in:

org.freedesktop.ConsoleKit.Manager.GetCurrentSession (OUT ssid)

This session-id (ssid) is a D-Bus object reference that can be used to get information about the session, like the "seat" ID it is attached to:

org.freedesktop.ConsoleKit.Session.GetSeatId (OUT sid)

If this seat-id (sid) is not set then the session is not attached to a seat.  We haven't fully spec'ed what a seat is but we know that:

* seat has a physical location
* seat generally corresponds to an input device and monitor
* can generally only switch to a user attached to the same seat
* only one session can be active on a seat at a time

At the moment we have implemented two kinds of seats: static and dynamic.  There is one static seat that is defined to contain all user sessions that originate from the local system.  Each remove session is allocated its own seat that exists only for the duration of that session.  Examples of remote sessions are: GDM XDMCP logins, ssh logins.

It might be interesting to offer FUS for XDMCP sessions but that will likely require some further work.  So, for the time being, FUS is only really possible on the local (static) seat.  If the current session is not on this type of seat then FUSA should probably not be shown.

To get the list of sessions attached to this seat:

org.freedesktop.ConsoleKit.Seat.GetSessions (OUT ssid-array)

will return an array of session-IDs.  For each of these ssid it is possible to get information about the session or to activate the session.

Here is an example of this in python:
http://gitweb.freedesktop.org/?p=ConsoleKit.git;a=blob_plain;h=3ac7921426b47cee17d67d2b2629b66b66a1bc3d;f=src/test-fus
Comment 1 Thomas Thurman 2006-11-02 03:11:39 UTC
This is really exciting. I'm looking forward to getting this working with FUSA.
Comment 2 Thomas Thurman 2006-11-11 21:49:43 UTC
Okay, I've been playing with this.

One problem I've run into (and it's certainly just me not understanding well enough) is that even when I run it under console-kit-daemon and then a recent gdm, the Python script you gave doesn't run unless it can find the environment variable XDG_SESSION_COOKIE. Now, I can grep through /proc for another process which has this variable, but how *should* it be supplied to the script?
Comment 3 William Jon McCann 2006-11-12 22:16:36 UTC
At least for now, the XDG_SESSION_COOKIE environment variable is used by the daemon to determine which session the calling process belongs to.  The variable is set by GDM when the session is initiated.  It will be inherited by all child processes  unless explicitly asked not to be.  So, basically it should be already set.

env | grep XDG_SESSION_COOKIE

I think we want to consider this variable an implementation detail so that we will be able to replace it with something else if other OSs have a better way or when we add a better way to Linux.

Does that answer your question?  Thanks for looking into this.

Also, this probably won't be able to solve bug 172912 directly.  We'll still need to enhance GDM for that and perhaps rethink how we use the GDM flexiservers.
Comment 4 William Jon McCann 2007-01-05 20:19:43 UTC
Hi,

Just wondering if you have had any luck with this or if you have any questions.
Comment 5 Thomas Thurman 2007-01-05 21:06:51 UTC
Been a little busy with the compositor problems, but I think I'll get to it before the end of the month.
Comment 6 Pavel Šefránek 2007-07-22 11:10:44 UTC
Has it been fixed? In Fedora 7 FUSA looks so.
Comment 7 Thomas Thurman 2007-07-22 22:21:18 UTC
I'll talk to the Fedora people, find out what they're doing, and get back to you.
Comment 8 Baptiste Mille-Mathias 2008-06-10 21:12:43 UTC
*** Bug 323954 has been marked as a duplicate of this bug. ***