[systemd-devel] pam_systemd closing user's session prematurely

Ray Strode halfline at gmail.com
Fri Oct 12 12:45:55 PDT 2012


Hi,

Some GDM/gnome-shell users having a rather strange issue where they
can't unlock their screen because logind thinks their session is no
longer active:

https://bugzilla.gnome.org/show_bug.cgi?id=685988

Turns out those users are running

$ su -

and upon typing

# exit

the users' sessions are put in the CLOSING state.  This is because
pam_sm_close session calls ReleaseSession which then closes the user's
fifo fd and immediately writes out the session state file.

Interestingly enough, ReleaseSession was written specifically for su:

commit 75c8e3cffd7da8eede614cf61384957af2c82a29
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Mar 22 02:06:40 2012 +0100

    logind: close FIFO before ending sessions cleanly

    For clean session endings ask logind explicitly to get rid of the FIFO
    before closing it so that the FIFO logic doesn't result in su/sudo to be
    terminated immediately.

I don't really understand the commit message, though.

I've attached a patch that bypasses ReleaseSession if CreateSession
returns the session the user is already in, but I fear it's wrong if
ReleaseSession was specifically designed for su, since we're
essentially bypassing it for the su case with my patch.

Thoughts?
--Ray
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dont-release.patch
Type: application/octet-stream
Size: 4512 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20121012/b4da82af/attachment.obj>


More information about the systemd-devel mailing list