Hi Yves-Alexis,

Bug report should be renamed to:
"no consolekit session available when libpam-systemd is
present" (not libpam-consolekit).

Following
https://lists.alioth.debian.org/pipermail/pkg-systemd-maintainers/2013-November/000812.html
that states that there is no problem to have consolekit and
libpam-systemd together, I tried a modified version of lightdm that
allows it (pach in attachment).
Note that one can achieve the same after installing libpam-ck-connector
(+removing the nox11 option) and
tweaking /etc/X11/Xsession.d/90consolekit so that consolekit is run
unconditionally.

So far i had no problem running lightdm+xfce4-session with 
consolekit only installed as well as with consolekit+libpam-systemd
installed. Test is not extensive (restart, shutdown, udisk are ok).

Given my poor coding experience, writing that patch looks too obvious
and I suspect I may have missed something, then I recommend to review it
carefully (upstream, maybe ?) in case you intend to use it.

BTW, this is unrelated because it affects lightdm and xfce4-session
versions already in archive, when libpam-systemd  is installed, if I
leave a session and log in again, loginctl shows previous sessions on
the same seat. Example:
$: loginctl -a
SESSION        UID USER             SEAT            
         1       1000 pascal           seat0           
         2       1000 pascal           seat0           
        c3        102 lightdm          seat0           
         3       1000 pascal           seat0           
4 sessions listed.
$: ck-list-sessions 
Session6:
        unix-user = '1000'
        realname = ''
        seat = 'Seat1'
        session-type = ''
        active = TRUE
        x11-display = ':0'
        x11-display-device = '/dev/tty7'
        display-device = ''
        remote-host-name = ''
        is-local = TRUE
        on-since = '2013-11-28T20:37:11.191451Z'
        login-session-id = '3'

I would have expected seeing only one session for the user (assuming
previous sessions have ended). I do not know if it is the normal
behavior or not and I do not know who to blame (lightdm or
xfce-session ?). I can open a bug report for that if you wish.

Regards
Pascal Dormeau




--- a/src/session.c	2013-10-30 21:41:46.000000000 +0100
+++ b/src/session.c	2013-11-28 19:59:37.218510065 +0100
@@ -766,8 +766,8 @@
 
     if (login1_is_running ())
         session->priv->login1_session = read_string_from_child (session);
-    if (!session->priv->login1_session)
-        session->priv->console_kit_cookie = read_string_from_child (session);
+
+    session->priv->console_kit_cookie = read_string_from_child (session);
 }
 
 void
@@ -778,7 +778,7 @@
     {
         if (session->priv->login1_session)
             login1_lock_session (session->priv->login1_session);
-        else if (session->priv->console_kit_cookie)
+        if (session->priv->console_kit_cookie)
             ck_lock_session (session->priv->console_kit_cookie);
     }
 }
@@ -791,7 +791,7 @@
     {
         if (session->priv->login1_session)
             login1_unlock_session (session->priv->login1_session);
-        else if (session->priv->console_kit_cookie)
+        if (session->priv->console_kit_cookie)
             ck_unlock_session (session->priv->console_kit_cookie);
     }
 }
--- a/src/session-child.c	2013-11-28 20:24:07.000000000 +0100
+++ b/src/session-child.c	2013-11-28 20:01:55.738515458 +0100
@@ -476,8 +476,8 @@
         write_string (login1_session);
     }
 
-    if (!login1_session)
-    {
+
+
         /* Open a Console Kit session */
         g_variant_builder_init (&ck_parameters, G_VARIANT_TYPE ("(a(sv))"));
         g_variant_builder_open (&ck_parameters, G_VARIANT_TYPE ("a(sv)"));
@@ -506,7 +506,7 @@
             pam_putenv (pam_handle, value);
             g_free (value);
         }
-    }
+
 
     /* Write X authority */
     if (x_authority)

Reply via email to