Bug 89024 - logind session gets stuck semi-often
Summary: logind session gets stuck semi-often
Status: RESOLVED WORKSFORME
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-07 20:49 UTC by Marius Vollmer
Modified: 2017-10-27 18:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Marius Vollmer 2015-02-07 20:49:16 UTC
systemd-216-17.fc21.x86_64

In our testsuite, we can fairly regularly observe sessions stuck in the 'closing' state without any processes in them:

3 - admin (1000)
           Since: Sat 2015-02-07 19:35:01 EET; 4min 41s ago
          Leader: 782
             TTY: cockpit-782
          Remote: 10.111.111.200
         Service: cockpit; type tty; class user
           State: closing
            Unit: session-3.scope
                  <empty>

As far as I can tell, this state persists indefinitely.  "loginctl terminate-session 3" will remove the session immediately.

The session is created by our own code.  The journal shows these messages:

Feb 07 16:57:08 localhost.localdomain systemd-logind[320]: New session 3 of user admin.
Feb 07 16:57:08 localhost.localdomain systemd[786]: pam_unix(systemd-user:session): session opened for user admin by (uid=0)
...
Feb 07 16:57:10 localhost.localdomain cockpit-session[781]: pam_unix(cockpit:session): session closed for user admin

Note that systemd seems to open the session, but cockpit-session seems to close it.  (If I have copied the right lines.)

Any hints for debugging this would be appreciated.
Comment 1 Lennart Poettering 2015-02-11 18:11:51 UTC
Smells like a bug with cgroup notifications. I need to debug that in some detail, we have seen this elsewhere too.

One thing however, before I look into that in detail: is there any reason why you fill in the TTY field with something that is not actually a TTY? we do idle-detection on the tty specified there, hence I'd prefer if that field could be properly initialize or not initialized at all...
Comment 2 Marius Vollmer 2015-02-12 09:03:16 UTC
(In reply to Lennart Poettering from comment #1)

> One thing however, before I look into that in detail: is there any reason
> why you fill in the TTY field with something that is not actually a TTY?

No, I think we cargo-culted that from somewhere else.  I'll change this.
Comment 3 Marius Vollmer 2015-02-12 09:44:30 UTC
https://github.com/cockpit-project/cockpit/pull/1808

Is that correct?  I took the liberty to set the session type to "web" although it is not one of the supported values.  I think you were going to add that type, no?
Comment 4 Lennart Poettering 2015-02-12 10:18:20 UTC
Yeah, looks good, commented in more detail on the github review thing...
Comment 5 Lennart Poettering 2017-10-27 18:11:30 UTC
I am pretty sure this works reliably on current systems. Closing. If this is still an issue, please file a new issue on github.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.