[systemd-devel] user at .service doesn't stop on logout

Jan Alexander Steffens jan.steffens at gmail.com
Tue Dec 10 11:22:39 PST 2013


On Tue, Dec 10, 2013 at 7:19 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> That service should be reference counted by the sessions of the users
> logging in. I should hence go away if the users successfully log out
> from their last session.
>
> Your screenshot shows the user as "closing". Usually that state is only
> entered if there are processes still around of the user even though the
> user logged out (such as screen). That's at least the theory, but there
> might be some bug left.
>
> Do you see any session of that user still around when you run into this
> issue?

I've been seeing this issue as well. After inspecting the code a bit,
here's my hypothesis about what happens:

The user manager is stopped by user_stop(), which is can either be
called directly (as "Terminate" over dbus) or via manager_gc().
However, in commit 405e205 you added checks to user_check_gc() that
prevent the user from getting garbage collected as long as the user
manager exists. As a result, users are in CLOSING state but never get
garbage collected.

Maybe those checks should be removed? AFAICT we already have Lingering
to ensure the manager survives the last session, and user_check_gc
already checks for that.

---

BTW, does anything actually set User's "closing" boolean? Seems like a
dead variable to me.


More information about the systemd-devel mailing list