You are not logged in.

#1 2024-12-22 10:38:57

Flapper
Member
Registered: 2019-02-10
Posts: 46

[SOLVED] systemd-user processes remain with state 'closing'

Every time I log off and log back on again I see more users logged on.

Normally I see 2 users:

andy@ArchPC2 ~> uptime
 22:02:30 up 2 days, 59 min,  2 users,  load average: 1.06, 1.14, 1.14

when I log out (eg to restart processes) and back in, it shows 3 users, and 4 the next time etc. It seems to be systemd-user processes which remain in state 'closing' but never close.
This has only started happening recently, since I upgraded systemd (256.9-1 -> 257-1) I think.

andy@ArchPC2 ~> loginctl list-sessions
SESSION  UID USER SEAT  LEADER CLASS   TTY  IDLE SINCE
      2 1000 andy -     597    manager -    no   -
      3 1000 andy seat0 234934 user    tty1 no   -
      4 1000 andy -     234961 manager -    no   -

andy@ArchPC2 ~> loginctl session-status 2
2 - andy (1000)
  Since: Thu 2024-12-19 21:03:47 GMT; 1 day 2h ago
  State: closing
 Leader: 597
 Remote: no
Service: systemd-user
   Type: unspecified
  Class: manager
   Idle: no

andy@ArchPC2 ~> loginctl session-status 4
4 - andy (1000)
  Since: Sat 2024-12-21 21:28:22 GMT; 38min ago
  State: active
 Leader: 234961 (systemd)
 Remote: no
Service: systemd-user
   Type: unspecified
  Class: manager
   Idle: no

I found an old issue where systemd-user processes remain in state 'closing'
https://github.com/systemd/systemd/issues/8672
but it was fixed.

As in this reported issue,

systemctl restart systemd-logind

restores the expected number of users. Have I got a process running which prevents it closing, or is it a systemd feature?

Last edited by Flapper (2024-12-22 16:17:20)

Offline

#2 2024-12-22 14:55:24

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,675

Re: [SOLVED] systemd-user processes remain with state 'closing'

Did you enable lingering, https://wiki.archlinux.org/title/System … _instances ?
What starts the session tbw? (startx or the "ly" DM involved?)
Does this happen if you only log in on the multi-user.target (2nd link below)?
What user services are (still) active?

Offline

#3 2024-12-22 16:16:02

Flapper
Member
Registered: 2019-02-10
Posts: 46

Re: [SOLVED] systemd-user processes remain with state 'closing'

No, lingering is not enabled.

I'm using Wayland. I start river from the main tty after logging in:
river -no-xwayland > /tmp/.river.log 2>&1

I do only log in on the multi-user.target.

I logged out to check your last question, and the problem seems to have resolved itself. Ihave only one user listed now.
I did a pacman -Syu first though, and one of the updates was systemd, so that may be it.
I will continue to monitor it, but marking as solved for now.

andy@ArchPC2 ~> uptime
 16:01:16 up 2 days, 18:58,  1 user,  load average: 0.88, 1.06, 1.06
andy@ArchPC2 ~> loginctl list-sessions
SESSION  UID USER SEAT  LEADER CLASS   TTY  IDLE SINCE
      6 1000 andy -     291299 manager -    no   -
      7 1000 andy seat0 291636 user    tty1 no   -

2 sessions listed.

Offline

#4 2024-12-23 07:05:53

Brocellous
Member
Registered: 2017-11-27
Posts: 161

Re: [SOLVED] systemd-user processes remain with state 'closing'

Hi Flapper,

#8672 has not been fixed upstream, but I intend to fix it with #35406, and it is my intention that this will be backported to the stable releases of systemd.

Are you able to reproduce this reliably? Can you share how? If you can reproduce on systemd 257.1, how many "Subscribed" fields are listed by systemd-analyze dump?

Thanks.

Offline

Board footer

Powered by FluxBB