[ConsoleKit] Passing CKCON_X11_DISPLAY to pam_ck_connector

Alkis Georgopoulos alkisg at gmail.com
Thu Mar 11 02:52:23 PST 2010


Hi,
to login users locally with LTSP, we're doing something like the
following:

root$ echo "CKCON_X11_DISPLAY=$DISPLAY" >> /etc/environment
root$ echo "CKCON_X11_DISPLAY_DEVICE=$(/usr/lib/ConsoleKit/ck-get-x11-display-device 2>/dev/null)" >> /etc/environment
root$ su user
user# <the user is now logged on, and the xsession.d scripts are executed>

That works fine, i.e. if we run:
user# ck-list-sessions | grep x11
we get:
        x11-display = ':0'
        x11-display-device = '/dev/tty7'

But having to modify /etc/environment to properly logon a user under X
surely isn't good practice.

So, I'd like to ask the following questions:
 * Exporting CKCON_X11_DISPLAY* on the current environment, and then
calling `su user` doesn't work for me. It seems that pam isn't reading
the environment of the calling process. Is there some way to make
pam_ck_connector read the values from the environment?

 * I tried pam_env.conf, and that worked, except that I can only set up
static entries there. So that wouldn't work for different CK sessions in
different X displays... Is there any way to do something like
  CKCON_X11_DISPLAY_DEVICE=$(/usr/lib/ConsoleKit/ck-get-x11-display-device 2>/dev/null)
in pam_env.conf ?

 * Any other ideas to properly logon users under X (that doesn't involve
direct OpenSessionWithParameters calls in C or python) would be much
appreciated. I don't think letting Xsession/90consolekit (=it calls
ck-launch-session) register the session would be a good way to do it
though, as some processes that ran as this user before 90consolekit
would not be contained in the CK session.

Thanks in advance.



More information about the ConsoleKit mailing list