logind: add "background-light" session class
This is the same as the "background" class, but does *not* pull in a service manager. It might be useful for things like select cron jobs that do not intend to call per-user IPC calls. Replaces: #23569 Fixes: #23978
This commit is contained in:
@@ -1639,13 +1639,14 @@ static const char* const session_type_table[_SESSION_TYPE_MAX] = {
|
||||
DEFINE_STRING_TABLE_LOOKUP(session_type, SessionType);
|
||||
|
||||
static const char* const session_class_table[_SESSION_CLASS_MAX] = {
|
||||
[SESSION_USER] = "user",
|
||||
[SESSION_USER_EARLY] = "user-early",
|
||||
[SESSION_GREETER] = "greeter",
|
||||
[SESSION_LOCK_SCREEN] = "lock-screen",
|
||||
[SESSION_BACKGROUND] = "background",
|
||||
[SESSION_MANAGER] = "manager",
|
||||
[SESSION_MANAGER_EARLY] = "manager-early",
|
||||
[SESSION_USER] = "user",
|
||||
[SESSION_USER_EARLY] = "user-early",
|
||||
[SESSION_GREETER] = "greeter",
|
||||
[SESSION_LOCK_SCREEN] = "lock-screen",
|
||||
[SESSION_BACKGROUND] = "background",
|
||||
[SESSION_BACKGROUND_LIGHT] = "background-light",
|
||||
[SESSION_MANAGER] = "manager",
|
||||
[SESSION_MANAGER_EARLY] = "manager-early",
|
||||
};
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(session_class, SessionClass);
|
||||
|
||||
@@ -25,6 +25,7 @@ typedef enum SessionClass {
|
||||
SESSION_GREETER, /* A login greeter pseudo-session */
|
||||
SESSION_LOCK_SCREEN, /* A lock screen */
|
||||
SESSION_BACKGROUND, /* Things like cron jobs, which are non-interactive */
|
||||
SESSION_BACKGROUND_LIGHT, /* Like SESSION_BACKGROUND, but without the service manager */
|
||||
SESSION_MANAGER, /* The service manager */
|
||||
SESSION_MANAGER_EARLY, /* The service manager for root (which is allowed to run before systemd-user-sessions.service) */
|
||||
_SESSION_CLASS_MAX,
|
||||
@@ -36,7 +37,7 @@ typedef enum SessionClass {
|
||||
#define SESSION_CLASS_IS_EARLY(class) IN_SET((class), SESSION_USER_EARLY, SESSION_MANAGER_EARLY)
|
||||
|
||||
/* Which session classes want their own scope units? (all of them, except the manager, which comes in its own service unit already */
|
||||
#define SESSION_CLASS_WANTS_SCOPE(class) IN_SET((class), SESSION_USER, SESSION_USER_EARLY, SESSION_GREETER, SESSION_LOCK_SCREEN, SESSION_BACKGROUND)
|
||||
#define SESSION_CLASS_WANTS_SCOPE(class) IN_SET((class), SESSION_USER, SESSION_USER_EARLY, SESSION_GREETER, SESSION_LOCK_SCREEN, SESSION_BACKGROUND, SESSION_BACKGROUND_LIGHT)
|
||||
|
||||
/* Which session classes want their own per-user service manager? */
|
||||
#define SESSION_CLASS_WANTS_SERVICE_MANAGER(class) IN_SET((class), SESSION_USER, SESSION_USER_EARLY, SESSION_GREETER, SESSION_LOCK_SCREEN, SESSION_BACKGROUND)
|
||||
|
||||
Reference in New Issue
Block a user