[arch-general] Systemd and inactive sessions
Hi, I have just noticed that systemd-logind doesn't terminate inactive sessions. For example, when I login, do something, then relogin, there are 2 sessions: $ loginctl SESSION UID USER SEAT 1 1000 lisaev seat0 4 1000 lisaev seat0 However, only session 4 is active. Session 1 is inactive and has state=closing: $ loginctl show-session 1 Id=1 Timestamp=Thu, 2012-11-01 14:42:18 CDT TimestampMonotonic=32156744 DefaultControlGroup=name=systemd:/user/lisaev/1 VTNr=1 TTY=tty1 Remote=no Service=login Leader=327 Audit=1 Type=tty Class=user Active=no State=closing KillProcesses=no IdleHint=yes IdleSinceHint=1351805395173515 IdleSinceHintMonotonic=6489608483 Name=lisaev Is that expected? Thanks, -- Leonid Isaev GnuPG key: 0x164B5A6D Fingerprint: C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D
On Thu, Nov 1, 2012 at 5:43 PM, Leonid Isaev <lisaev@umail.iu.edu> wrote:
Hi,
I have just noticed that systemd-logind doesn't terminate inactive sessions. For example, when I login, do something, then relogin, there are 2 sessions: $ loginctl SESSION UID USER SEAT 1 1000 lisaev seat0 4 1000 lisaev seat0 However, only session 4 is active. Session 1 is inactive and has state=closing: $ loginctl show-session 1 Id=1 Timestamp=Thu, 2012-11-01 14:42:18 CDT TimestampMonotonic=32156744 DefaultControlGroup=name=systemd:/user/lisaev/1 VTNr=1 TTY=tty1 Remote=no Service=login Leader=327 Audit=1 Type=tty Class=user Active=no State=closing KillProcesses=no IdleHint=yes IdleSinceHint=1351805395173515 IdleSinceHintMonotonic=6489608483 Name=lisaev
Is that expected?
Notice that State=closing. That means some process is still running which was started under that session. The old session will be removed when all processes in it exit. Run "systemd-cgls" to see what these processes are.
On 11/01/2012 03:43 PM, Leonid Isaev wrote:
Hi,
I have just noticed that systemd-logind doesn't terminate inactive sessions. For example, when I login, do something, then relogin, there are 2 sessions: $ loginctl SESSION UID USER SEAT 1 1000 lisaev seat0 4 1000 lisaev seat0 However, only session 4 is active. Session 1 is inactive and has state=closing: $ loginctl show-session 1 Id=1 Timestamp=Thu, 2012-11-01 14:42:18 CDT TimestampMonotonic=32156744 DefaultControlGroup=name=systemd:/user/lisaev/1 VTNr=1 TTY=tty1 Remote=no Service=login Leader=327 Audit=1 Type=tty Class=user Active=no State=closing KillProcesses=no IdleHint=yes IdleSinceHint=1351805395173515 IdleSinceHintMonotonic=6489608483 Name=lisaev
Is that expected?
Thanks,
The session doesn't get removed completely until all processes belonging to it's cgroup have closed on their own.
On Thu, 01 Nov 2012 22:57:41 +0100 Thomas Bächler <thomas@archlinux.org> wrote:
Am 01.11.2012 22:51, schrieb Matthew Monaco:
$ loginctl show-session 1
Try session-status.
Yes, found the ghost fetchmail process.
The session doesn't get removed completely until all processes belonging to it's cgroup have closed on their own.
See man logind.conf, search for 'KillUserProcesses'.
OK, changed to 'yes' to avoid future confusion... Loving the support :) -- Leonid Isaev GnuPG key: 0x164B5A6D Fingerprint: C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D
On 11/01/2012 06:47 PM, Leonid Isaev wrote:
On Thu, 01 Nov 2012 22:57:41 +0100 Thomas Bächler <thomas@archlinux.org> wrote:
The session doesn't get removed completely until all processes belonging to it's cgroup have closed on their own.
See man logind.conf, search for 'KillUserProcesses'.
OK, changed to 'yes' to avoid future confusion... Loving the support :)
Important caveat to that setting: "Note that setting KillUserProcesses=1 will break tools like screen(1)" DR
On Mon, 05 Nov 2012 16:21:21 -0500 David Rosenstrauch <darose@darose.net> wrote:
On 11/01/2012 06:47 PM, Leonid Isaev wrote:
On Thu, 01 Nov 2012 22:57:41 +0100 Thomas Bächler <thomas@archlinux.org> wrote:
The session doesn't get removed completely until all processes belonging to it's cgroup have closed on their own.
See man logind.conf, search for 'KillUserProcesses'.
OK, changed to 'yes' to avoid future confusion... Loving the support :)
Important caveat to that setting:
"Note that setting KillUserProcesses=1 will break tools like screen(1)"
DR
Yes, I learnt that the hard way :) So it's a useful setting for a laptop, but obviously not for a server... -- Leonid Isaev GnuPG key: 0x164B5A6D Fingerprint: C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D
Am 05.11.2012 22:43, schrieb Leonid Isaev:
Important caveat to that setting:
"Note that setting KillUserProcesses=1 will break tools like screen(1)"
DR
Yes, I learnt that the hard way :) So it's a useful setting for a laptop, but obviously not for a server...
I was hoping to be able to fix that. In theory, we could teach screen to open a PAM session and teach logind to respect screen as a session master - but I really don't know where to start.
On Thu, 01 Nov 2012 15:51:38 -0600 Matthew Monaco <dgbaley27@0x01b.net> wrote:
On 11/01/2012 03:43 PM, Leonid Isaev wrote:
Hi,
I have just noticed that systemd-logind doesn't terminate inactive sessions. For example, when I login, do something, then relogin, there are 2 sessions: $ loginctl SESSION UID USER SEAT 1 1000 lisaev seat0 4 1000 lisaev seat0 However, only session 4 is active. Session 1 is inactive and has state=closing: $ loginctl show-session 1 Id=1 Timestamp=Thu, 2012-11-01 14:42:18 CDT TimestampMonotonic=32156744 DefaultControlGroup=name=systemd:/user/lisaev/1 VTNr=1 TTY=tty1 Remote=no Service=login Leader=327 Audit=1 Type=tty Class=user Active=no State=closing KillProcesses=no IdleHint=yes IdleSinceHint=1351805395173515 IdleSinceHintMonotonic=6489608483 Name=lisaev
Is that expected?
Thanks,
The session doesn't get removed completely until all processes belonging to it's cgroup have closed on their own.
Ahh, you are right, there was a fetchmail running in the background. Thanks for the help. -- Leonid Isaev GnuPG key: 0x164B5A6D Fingerprint: C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D
participants (5)
-
David Rosenstrauch
-
Leonid Isaev
-
Matthew Monaco
-
Ray Kohler
-
Thomas Bächler