[Xfce4-commits] <xfce4-session:master> Reuse existing ConsoleKit sessions (bug #6685).
Yves-Alexis Perez
corsac at debian.org
Mon Sep 20 08:07:24 CEST 2010
On dim., 2010-09-19 at 23:25 +0200, Jannis Pohlmann wrote:
> > > Maybe calling ck-l-s within xfce4-session is just too late?
> >
> > I don't think so, but starting CK unconditionally while there might be
> > another session running may lead to troubles.
>
> Yes. The question is how scripts (e.g. the ones on Debian) decide when
> to open a new ConsoleKit session that is set up to work with XOrg/Xfce.
> Can you find out what the conditions are or what is done to set up
> ConsoleKit when calling "startx"?
When only doing startx, scripts in /etc/X11/Xsession.d gets executed,
and 90consolekit is:
----
# -*- sh -*-
# Xsession.d script for ck-launch-session.
#
#
# This file is sourced by Xsession(5), not executed.
CK_LAUNCH_SESSION=/usr/bin/ck-launch-session
is_on_console() {
session=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
--type=method_call --print-reply --reply-timeout=2000 \
/org/freedesktop/ConsoleKit/Manager \
org.freedesktop.ConsoleKit.Manager.GetCurrentSession \
| grep path | awk '{print $3}' | sed s/\"//g)
x11_display=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
--type=method_call --print-reply --reply-timeout=2000 \
$session org.freedesktop.ConsoleKit.Session.GetX11Display \
| grep string | awk '{print $2}' | sed s/\"//g)
if [ -z "$x11_display" ] ; then
return 0
else
return 1
fi
}
# gdm already creates a CK session for us, so do not run the expensive D-Bus
# calls if we have $GDMSESSION
if [ -z "$GDMSESSION" ] && [ -x "$CK_LAUNCH_SESSION" ] && \
( [ -z "$XDG_SESSION_COOKIE" ] || is_on_console ) ; then
STARTUP="$CK_LAUNCH_SESSION $STARTUP"
fi
So basically it checks if we runs from GDM (which sets the stuff itself)
or if $XDG_SESSION_COOKIE is set (by the pam connector). I'm not too
sure about the is_on_console, maybe it's for people wanting to reuse
90consolekit for console use.
Cheers,
--
Yves-Alexis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20100920/d73dd4dc/attachment.pgp>
More information about the Xfce4-dev
mailing list