Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logged out session still tracked by logind #26744

Open
hexchain opened this issue Mar 10, 2023 · 4 comments
Open

Logged out session still tracked by logind #26744

hexchain opened this issue Mar 10, 2023 · 4 comments
Labels
bug 🐛 Programming errors, that need preferential fixing logind

Comments

@hexchain
Copy link
Contributor

systemd version the issue has been seen with

253.1

Used distribution

Arch Linux

Linux kernel version used

6.2.1-arch1-1

CPU architectures issue was seen on

x86_64

Component

systemd-logind

Expected behaviour you didn't see

After a session has been logged out and all tasks are stopped, that session should no longer exist in loginctl.

Unexpected behaviour you saw

Logged out sessions still show up in loginctl.

In the following example, sessions 8, 10, and c3 are already logged out. Session 8 is a Plasma Wayland session, logged in through SDDM. Session 10 is a TTY session, created by C-A-F4 and logging in there.

% loginctl
SESSION  UID USER     SEAT  TTY
     10 1000 hexchain seat0 tty4
      2 1000 hexchain seat0 tty1
      8 1001 thc      seat0 tty4
     c3  973 sddm     seat0

4 sessions listed.

% loginctl show-session 10
Id=10
User=1000
Name=hexchain
Timestamp=Fri 2023-03-10 14:52:11 +08
TimestampMonotonic=80455612140
VTNr=4
Seat=seat0
TTY=tty4
Remote=no
Service=login
Scope=session-10.scope
Leader=133675
Audit=10
Type=tty
Class=user
Active=no
State=closing
IdleHint=no
IdleSinceHint=1678431129781660
IdleSinceHintMonotonic=80453572525
LockedHint=no

% systemctl status session-10.scope
Unit session-10.scope could not be found.

% loginctl terminate-session 10
% loginctl terminate-session 10
% loginctl kill-session 10
Could not kill session: No such file or directory

% loginctl show-session 10
Id=10
User=1000
Name=hexchain
Timestamp=Fri 2023-03-10 14:52:11 +08
TimestampMonotonic=80455612140
VTNr=4
Seat=seat0
TTY=tty4
Remote=no
Service=login
Scope=session-10.scope
Leader=133675
Audit=10
Type=tty
Class=user
Active=no
State=closing
IdleHint=no
IdleSinceHint=1678431129781660
IdleSinceHintMonotonic=80453572526
LockedHint=no

% loginctl
SESSION  UID USER     SEAT  TTY
     10 1000 hexchain seat0 tty4
      2 1000 hexchain seat0 tty1
      8 1001 thc      seat0 tty4
     c3  973 sddm     seat0

4 sessions listed.

Steps to reproduce the problem

I haven't figured out a stable way to reproduce, sorry.

The desktop manager in use is sddm/sddm@5341b06.

Additional program output to the terminal or log subsystem illustrating the issue

% journalctl -b -u systemd-logind | grep -v 'Watching system buttons on'
Mar 09 16:31:25 hitori systemd[1]: Starting User Login Management...
Mar 09 16:31:25 hitori systemd-logind[569]: New seat seat0.
Mar 09 16:31:25 hitori systemd[1]: Started User Login Management.
Mar 09 16:31:27 hitori systemd-logind[569]: New session c1 of user sddm.
Mar 09 16:33:43 hitori systemd-logind[569]: New session 2 of user hexchain.
Mar 09 16:33:43 hitori systemd-logind[569]: Session c1 logged out. Waiting for processes to exit.
Mar 09 16:33:43 hitori systemd-logind[569]: Removed session c1.
Mar 09 16:33:59 hitori systemd-logind[569]: New session c2 of user sddm.
Mar 09 16:34:04 hitori systemd-logind[569]: New session 5 of user thc.
Mar 09 16:34:04 hitori systemd-logind[569]: Session c2 logged out. Waiting for processes to exit.
Mar 09 16:34:04 hitori systemd-logind[569]: Removed session c2.
Mar 09 22:18:23 hitori systemd-logind[569]: Session 5 logged out. Waiting for processes to exit.
Mar 09 22:18:23 hitori systemd-logind[569]: Removed session 5.
Mar 10 10:41:35 hitori systemd-logind[569]: New session c3 of user sddm.
Mar 10 10:41:40 hitori systemd-logind[569]: New session 8 of user thc.
Mar 10 10:41:40 hitori systemd-logind[569]: Session c3 logged out. Waiting for processes to exit.
Mar 10 14:26:17 hitori systemd-logind[569]: Session 8 logged out. Waiting for processes to exit.
Mar 10 14:52:11 hitori systemd-logind[569]: New session 10 of user hexchain.
Mar 10 14:52:15 hitori systemd-logind[569]: Session 10 logged out. Waiting for processes to exit.
@hexchain hexchain added the bug 🐛 Programming errors, that need preferential fixing label Mar 10, 2023
@emansom
Copy link
Contributor

emansom commented Mar 22, 2023

Experiencing this as well. Same system configuration.

@georgmu
Copy link
Contributor

georgmu commented Apr 24, 2023

Same problem with Fedora 38, systemd-253.2-1.fc38.x86_64

@rhansen
Copy link

rhansen commented Apr 26, 2023

I think this problem has been around for a while; see bug #14850. I'm noticing it on a system with systemd 245.4.

@kanashimia
Copy link

An easy way to reproduce this using machinectl shell:

$ loginctl
...
N sessions listed.

$ machinectl shell .host /bin/sh -c exit
...

$ loginctl
...
N+1 sessions listed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Programming errors, that need preferential fixing logind
Development

No branches or pull requests

5 participants