]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: add new 'user-incomplete' session class
authorLennart Poettering <lennart@poettering.net>
Mon, 27 Nov 2023 17:36:06 +0000 (18:36 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 14 Feb 2024 13:58:37 +0000 (14:58 +0100)
man/pam_systemd.xml
man/sd_session_is_active.xml
src/login/logind-session.c
src/login/logind-session.h

index 1a841df13bf19441a0ce0a9908a11080f1d32f18..dcd104907a51ff2692a3a2dccf5809e4cc04b01b 100644 (file)
                 <entry><constant>user-early</constant></entry>
                 <entry>Similar to <literal>user</literal> but sessions of this class are not ordered after <filename>systemd-user-sessions.service</filename>, i.e. may be started before regular sessions are allowed to be established. This session class is the default for sessions of the root user that would otherwise qualify for the <constant>user</constant> class, see above. (Added in v256.)</entry>
               </row>
+              <row>
+                <entry><constant>user-incomplete</constant></entry>
+                <entry>Similar to <literal>user</literal> but for sessions which are not fully set up yet, i.e. have no home directory mounted ot similar. This is used by <citerefentry><refentrytitle>systemd-homed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> to allow users to log in via <command>ssh</command> before their home directory is mounted, delaying the mount until the user provided the unlock password. Sessions of this class are upgraded to the regular <constant>user</constant> class once the home directory is activated.</entry>
+              </row>
               <row>
                 <entry><constant>greeter</constant></entry>
                 <entry>Similar to <literal>user</literal> but for sessions that are spawned by a display manager ephemerally and which prompt the user for login credentials.</entry>
index 747fab4c68ff2ceb7e99b8614a490e1d14409923..1cbef64e003c14f2008e94e5bc8ea0555ff773bb 100644 (file)
 
     <para><function>sd_session_get_class()</function> may be used to determine the class of the session
     identified by the specified session identifier. The returned string is one of <literal>user</literal>,
-    <literal>user-early</literal>, <literal>greeter</literal>, <literal>lock-screen</literal>,
-    <literal>background</literal>, <literal>background-light</literal>, <literal>manager</literal> or
-    <literal>manager-early</literal> and needs to be freed with the libc <citerefentry
+    <literal>user-early</literal>, <literal>user-incomplete</literal>, <literal>greeter</literal>,
+    <literal>lock-screen</literal>, <literal>background</literal>, <literal>background-light</literal>,
+    <literal>manager</literal> or <literal>manager-early</literal> and needs to be freed with the libc
+    <citerefentry
     project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry> call after
     use.</para>
 
index 69dc52ad66ce0d025c081cd5270d38abc1bc265e..ffdd42002aeedd93ca97f50e4597adc8ebff3c77 100644 (file)
@@ -1648,6 +1648,7 @@ 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_USER_INCOMPLETE]   = "user-incomplete",
         [SESSION_GREETER]           = "greeter",
         [SESSION_LOCK_SCREEN]       = "lock-screen",
         [SESSION_BACKGROUND]        = "background",
index 6a0fb5430359f4fbb8895c66f7f786a4cf84d3d2..34cf9b075bce3a3375f2c7cf5184a51cdbcdccad 100644 (file)
@@ -22,6 +22,7 @@ typedef enum SessionState {
 typedef enum SessionClass {
         SESSION_USER,               /* A regular user session */
         SESSION_USER_EARLY,         /* A user session, that is not ordered after systemd-user-sessions.service (i.e. for root) */
+        SESSION_USER_INCOMPLETE,    /* A user session that is only half-way set up and doesn't pull in the service manager, and can be upgraded to a full user session later */
         SESSION_GREETER,            /* A login greeter pseudo-session */
         SESSION_LOCK_SCREEN,        /* A lock screen */
         SESSION_BACKGROUND,         /* Things like cron jobs, which are non-interactive */
@@ -37,7 +38,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, SESSION_BACKGROUND_LIGHT)
+#define SESSION_CLASS_WANTS_SCOPE(class) IN_SET((class), SESSION_USER, SESSION_USER_EARLY, SESSION_USER_INCOMPLETE, 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)