Bug 55272

Summary: logind: Session.kill_processes not working
Product: systemd Reporter: Matthew Monaco <dgbaley27>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: dgbaley27, grawity, vovan
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Matthew Monaco 2012-09-24 06:53:45 UTC
There's a bit of an issue with the kill-session-processes=1 logic. When session_check_gc() is called, session_remove_fifo() hasn't been called yet, so gc can't happen on the session.

Additionally, the check for cg_is_empty_recursive() might need to be guarded by s->cgroup_path && !s->kill_processes because we don't care if the cgroup is empty in this situation.
Comment 1 Matthew Monaco 2012-09-26 19:01:52 UTC
I was backwards there. In response to dbus ReleaseSession(), session_remove_fifo() is called. But this doesn't have any effect until we're in session_check_gc(), which normally isn't called until the session is but in the GC Queue.

However, normally, the way the session is put in the GC Queue is after logind receivs the dbus signal that the sessions cgroup is empty. This obviously won't happen in cases where kill-user-sessions=1 is actually required.

(I still think gc_is_empty_recursive() in session_check_gc() should be guarded by !s->kill_processes)
Comment 2 Lennart Poettering 2014-02-21 17:33:03 UTC
This should work fin with 209.

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.