Files
systemd/src
Mike Yuan e2a42c0c43 logind-user: track user started/stopping state through user-runtime-dir@.service
Before #30884, the user state is tied to user@.service (user service
manager). However, #30884 introduced sessions that need no manager,
and we can no longer rely on that.

Consider the following situation:

1. A 'background-light' session '1' is created (i.e. no user service manager
   is needed)
2. Session '1' scope unit pulls in user-runtime-dir@.service
3. Session '1' exits. A stop job is enqueued for user-runtime-dir@.service
   due to StopWhenUnneeded=yes
4. At the same time, another session '2' which requires user manager is started.
   However, session scope units have JobMode=fail, therefore the start job
   for user-runtime-dir@.service that was pulled in by session '2' scope job
   is deleted as it conflicts with the stop job.

We want session scope units to continue using JobMode=fail, but we still need
the dependencies to be started correctly, i.e. explicitly requested by logind
beforehand. Therefore, let's stop using StopWhenUnneeded=yes for
user-runtime-dir@.service, and track users' `started` and `stopping` state
based on that when user@.service is not needed. Then, for every invocation
of user_start(), we'll recheck if we need the service manager and start it
if so.

Also, the dependency type on user-runtime-dir@.service from user@.service
is upgraded to `BindsTo=`, in order to ensure that when logind stops the
former, the latter is stopped as well.
2024-02-15 19:23:44 +08:00
..
2024-02-14 16:15:19 +01:00
2024-02-08 19:48:49 +01:00
2024-02-14 04:01:52 +09:00
2024-01-04 15:22:42 +01:00
2024-02-08 11:34:36 +09:00
2024-01-09 21:57:46 +08:00
2024-02-12 02:52:37 +09:00
2024-01-30 10:11:30 +01:00
2024-02-09 18:27:01 +01:00
2024-02-14 16:15:19 +01:00
2024-01-09 21:57:45 +08:00
2024-01-04 20:33:32 +08:00
2024-01-04 23:35:13 +08:00