]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/org.freedesktop.login1.xml
Merge pull request #28919 from fbuihuu/custom-config-file-install-path
[thirdparty/systemd.git] / man / org.freedesktop.login1.xml
index ad27b226b8ab2c8b8010ee3a94de42231dd1bcde..4a94656f6625d921c3090b253755684fb4cce60c 100644 (file)
@@ -56,6 +56,7 @@ node /org/freedesktop/login1 {
       ListUsers(out a(uso) users);
       ListSeats(out a(so) seats);
       ListInhibitors(out a(ssssuu) inhibitors);
+      @org.freedesktop.systemd1.Privileged("true")
       CreateSession(in  u uid,
                     in  u pid,
                     in  s service,
@@ -78,6 +79,7 @@ node /org/freedesktop/login1 {
                     out s seat_id,
                     out u vtnr,
                     out b existing);
+      @org.freedesktop.systemd1.Privileged("true")
       ReleaseSession(in  s session_id);
       ActivateSession(in  s session_id);
       ActivateSessionOnSeat(in  s session_id,
@@ -102,12 +104,19 @@ node /org/freedesktop/login1 {
                    in  b interactive);
       FlushDevices(in  b interactive);
       PowerOff(in  b interactive);
+      PowerOffWithFlags(in  t flags);
       Reboot(in  b interactive);
+      RebootWithFlags(in  t flags);
       Halt(in  b interactive);
+      HaltWithFlags(in  t flags);
       Suspend(in  b interactive);
+      SuspendWithFlags(in  t flags);
       Hibernate(in  b interactive);
+      HibernateWithFlags(in  t flags);
       HybridSleep(in  b interactive);
+      HybridSleepWithFlags(in  t flags);
       SuspendThenHibernate(in  b interactive);
+      SuspendThenHibernateWithFlags(in  t flags);
       CanPowerOff(out s result);
       CanReboot(out s result);
       CanHalt(out s result);
@@ -147,6 +156,8 @@ node /org/freedesktop/login1 {
       SeatRemoved(s seat_id,
                   o object_path);
       PrepareForShutdown(b start);
+      PrepareForShutdownWithMetadata(b start,
+                                     a{sv} metadata);
       PrepareForSleep(b start);
     properties:
       @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
@@ -185,10 +196,20 @@ node /org/freedesktop/login1 {
       @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
       readonly s HandlePowerKey = '...';
       @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+      readonly s HandlePowerKeyLongPress = '...';
+      @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+      readonly s HandleRebootKey = '...';
+      @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+      readonly s HandleRebootKeyLongPress = '...';
+      @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
       readonly s HandleSuspendKey = '...';
       @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+      readonly s HandleSuspendKeyLongPress = '...';
+      @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
       readonly s HandleHibernateKey = '...';
       @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+      readonly s HandleHibernateKeyLongPress = '...';
+      @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
       readonly s HandleLidSwitch = '...';
       @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
       readonly s HandleLidSwitchExternalPower = '...';
@@ -226,6 +247,8 @@ node /org/freedesktop/login1 {
       readonly t SessionsMax = ...;
       @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
       readonly t NCurrentSessions = ...;
+      @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+      readonly t StopIdleSessionUSec = ...;
   };
   interface org.freedesktop.DBus.Peer { ... };
   interface org.freedesktop.DBus.Introspectable { ... };
@@ -233,6 +256,18 @@ node /org/freedesktop/login1 {
 };
     </programlisting>
 
+    <!--property HandlePowerKeyLongPress is not documented!-->
+
+    <!--property HandleRebootKey is not documented!-->
+
+    <!--property HandleRebootKeyLongPress is not documented!-->
+
+    <!--property HandleSuspendKeyLongPress is not documented!-->
+
+    <!--property HandleHibernateKeyLongPress is not documented!-->
+
+    <!--property StopIdleSessionUSec is not documented!-->
+
     <!--Autogenerated cross-references for systemd.directives, do not edit-->
 
     <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.login1.Manager"/>
@@ -291,18 +326,32 @@ node /org/freedesktop/login1 {
 
     <variablelist class="dbus-method" generated="True" extra-ref="PowerOff()"/>
 
+    <variablelist class="dbus-method" generated="True" extra-ref="PowerOffWithFlags()"/>
+
     <variablelist class="dbus-method" generated="True" extra-ref="Reboot()"/>
 
+    <variablelist class="dbus-method" generated="True" extra-ref="RebootWithFlags()"/>
+
     <variablelist class="dbus-method" generated="True" extra-ref="Halt()"/>
 
+    <variablelist class="dbus-method" generated="True" extra-ref="HaltWithFlags()"/>
+
     <variablelist class="dbus-method" generated="True" extra-ref="Suspend()"/>
 
+    <variablelist class="dbus-method" generated="True" extra-ref="SuspendWithFlags()"/>
+
     <variablelist class="dbus-method" generated="True" extra-ref="Hibernate()"/>
 
+    <variablelist class="dbus-method" generated="True" extra-ref="HibernateWithFlags()"/>
+
     <variablelist class="dbus-method" generated="True" extra-ref="HybridSleep()"/>
 
+    <variablelist class="dbus-method" generated="True" extra-ref="HybridSleepWithFlags()"/>
+
     <variablelist class="dbus-method" generated="True" extra-ref="SuspendThenHibernate()"/>
 
+    <variablelist class="dbus-method" generated="True" extra-ref="SuspendThenHibernateWithFlags()"/>
+
     <variablelist class="dbus-method" generated="True" extra-ref="CanPowerOff()"/>
 
     <variablelist class="dbus-method" generated="True" extra-ref="CanReboot()"/>
@@ -355,6 +404,8 @@ node /org/freedesktop/login1 {
 
     <variablelist class="dbus-signal" generated="True" extra-ref="PrepareForShutdown"/>
 
+    <variablelist class="dbus-signal" generated="True" extra-ref="PrepareForShutdownWithMetadata"/>
+
     <variablelist class="dbus-signal" generated="True" extra-ref="PrepareForSleep"/>
 
     <variablelist class="dbus-property" generated="True" extra-ref="EnableWallMessages"/>
@@ -395,10 +446,20 @@ node /org/freedesktop/login1 {
 
     <variablelist class="dbus-property" generated="True" extra-ref="HandlePowerKey"/>
 
+    <variablelist class="dbus-property" generated="True" extra-ref="HandlePowerKeyLongPress"/>
+
+    <variablelist class="dbus-property" generated="True" extra-ref="HandleRebootKey"/>
+
+    <variablelist class="dbus-property" generated="True" extra-ref="HandleRebootKeyLongPress"/>
+
     <variablelist class="dbus-property" generated="True" extra-ref="HandleSuspendKey"/>
 
+    <variablelist class="dbus-property" generated="True" extra-ref="HandleSuspendKeyLongPress"/>
+
     <variablelist class="dbus-property" generated="True" extra-ref="HandleHibernateKey"/>
 
+    <variablelist class="dbus-property" generated="True" extra-ref="HandleHibernateKeyLongPress"/>
+
     <variablelist class="dbus-property" generated="True" extra-ref="HandleLidSwitch"/>
 
     <variablelist class="dbus-property" generated="True" extra-ref="HandleLidSwitchExternalPower"/>
@@ -437,6 +498,8 @@ node /org/freedesktop/login1 {
 
     <variablelist class="dbus-property" generated="True" extra-ref="NCurrentSessions"/>
 
+    <variablelist class="dbus-property" generated="True" extra-ref="StopIdleSessionUSec"/>
+
     <!--End of Autogenerated section-->
 
     <refsect2>
@@ -517,16 +580,31 @@ node /org/freedesktop/login1 {
 
       <para><function>PowerOff()</function>, <function>Reboot()</function>, <function>Halt()</function>,
       <function>Suspend()</function>, and <function>Hibernate()</function> result in the system being powered
-      off, rebooted, halted (shut down without turning off power), suspended (the system state is
-      saved to RAM and the CPU is turned off), or hibernated (the system state is saved to disk and
-      the machine is powered down). <function>HybridSleep()</function> results in the system entering a
-      hybrid-sleep mode, i.e. the system is both hibernated and suspended.
-      <function>SuspendThenHibernate()</function> results in the system being suspended, then later woken
-      using an RTC timer and hibernated. The only argument is the polkit interactivity boolean
-      <varname>interactive</varname> (see below). The main purpose of these calls is that they enforce
-      polkit policy and hence allow powering off/rebooting/suspending/hibernating even by unprivileged
-      users. They also enforce inhibition locks. UIs should expose these calls as the primary mechanism to
-      poweroff/reboot/suspend/hibernate the machine.</para>
+      off, rebooted, halted (shut down without turning off power), suspended (the system state is saved to
+      RAM and the CPU is turned off), or hibernated (the system state is saved to disk and the machine is
+      powered down). <function>HybridSleep()</function> results in the system entering a hybrid-sleep mode,
+      i.e. the system is both hibernated and suspended.  <function>SuspendThenHibernate()</function> results
+      in the system being suspended, then later woken using an RTC timer and hibernated. The only argument is
+      the polkit interactivity boolean <varname>interactive</varname> (see below). The main purpose of these
+      calls is that they enforce polkit policy and hence allow powering off/rebooting/suspending/hibernating
+      even by unprivileged users. They also enforce inhibition locks for non-privileged users. UIs should
+      expose these calls as the primary mechanism to poweroff/reboot/suspend/hibernate the machine. Methods
+      <function>PowerOffWithFlags()</function>, <function>RebootWithFlags()</function>,
+      <function>HaltWithFlags()</function>, <function>SuspendWithFlags()</function>,
+      <function>HibernateWithFlags()</function>, <function>HybridSleepWithFlags()</function> and
+      <function>SuspendThenHibernateWithFlags()</function> add <varname>flags</varname> to allow for
+      extendability, defined as follows:</para>
+      <programlisting>
+#define SD_LOGIND_ROOT_CHECK_INHIBITORS  (UINT64_C(1) &lt;&lt; 0)
+#define SD_LOGIND_KEXEC_REBOOT           (UINT64_C(1) &lt;&lt; 1)
+#define SD_LOGIND_SOFT_REBOOT            (UINT64_C(1) &lt;&lt; 2)
+      </programlisting>
+      <para>When the <varname>flags</varname> is 0 then these methods behave just like the versions without
+      flags. When <constant>SD_LOGIND_ROOT_CHECK_INHIBITORS</constant> (0x01) is set, active inhibitors are
+      honoured for privileged users too. When <constant>SD_LOGIND_KEXEC_REBOOT</constant> (0x02) is set, then
+      <function>RebootWithFlags()</function> performs a kexec reboot if kexec kernel is loaded. When
+      <constant>SD_LOGIND_SOFT_REBOOT</constant> (0x04) is set, then <function>RebootWithFlags()</function>
+      performs a userspace reboot only.</para>
 
       <para><function>SetRebootParameter()</function> sets a parameter for a subsequent reboot operation.
       See the description of <command>reboot</command> in
@@ -584,7 +662,7 @@ node /org/freedesktop/login1 {
       whether the inhibit shall be consider mandatory or whether it should just delay the operation to a
       certain maximum time. The method returns a file descriptor. The lock is released the moment this file
       descriptor and all its duplicates are closed. For more information on the inhibition logic see
-      <ulink url="http://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor Locks</ulink>.
+      <ulink url="https://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor Locks</ulink>.
       </para>
     </refsect2>
 
@@ -600,15 +678,20 @@ node /org/freedesktop/login1 {
       logs in or out, or a seat is added or removed. They each contain the ID of the object plus the object
       path.</para>
 
-      <para>The <function>PrepareForShutdown()</function> and <function>PrepareForSleep()</function> signals
-      are sent right before (with the argument <literal>true</literal>) or after (with the argument
+      <para>The <function>PrepareForShutdown</function>,
+      <function>PrepareForShutdownWithMetadata</function>, and <function>PrepareForSleep</function>
+      signals are sent right before (with the argument <literal>true</literal>) or after (with the argument
       <literal>false</literal>) the system goes down for reboot/poweroff and suspend/hibernate,
       respectively. This may be used by applications to save data on disk, release memory, or do other jobs
       that should be done shortly before shutdown/sleep, in conjunction with delay inhibitor locks. After
       completion of this work they should release their inhibition locks in order to not delay the operation
       any further. For more information see
-      <ulink url="http://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor Locks</ulink>.
-      </para>
+      <ulink url="https://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor Locks</ulink>. The
+      <function>PrepareForShutdownWithMetadata()</function> signal additionally sends a list of key/value
+      pair metadata fields. Currently it sends a <varname>type</varname> string which defines the type of
+      shutdown. The type can be one of <literal>power-off</literal>, <literal>reboot</literal>,
+      <literal>halt</literal>, <literal>kexec</literal> or <literal>soft-reboot</literal>. This signal is
+      sent first, followed by <function>PrepareForShutdown</function> (for backward compatibility).</para>
     </refsect2>
 
     <refsect2>
@@ -806,8 +889,9 @@ node /org/freedesktop/login1/seat/seat0 {
     <refsect2>
       <title>Methods</title>
 
-      <para><function>Terminate()</function> and <function>ActivateSession()</function> work similar to
-      TerminateSeat(), ActivationSessionOnSeat() on the Manager object.</para>
+      <para><function>Terminate()</function> and <function>ActivateSession()</function> work similarly to
+      <function>TerminateSeat()</function> and <function>ActivationSessionOnSeat()</function> on the Manager
+      object.</para>
 
       <para><function>SwitchTo()</function> switches to the session on the virtual terminal
       <varname>vtnr</varname>. <function>SwitchToNext()</function> and
@@ -840,8 +924,8 @@ node /org/freedesktop/login1/seat/seat0 {
       encoded in a structure consisting of the ID and the object path.</para>
 
       <para>The <varname>IdleHint</varname>, <varname>IdleSinceHint</varname>, and
-      <varname>IdleSinceHintMonotonic</varname> properties encode the idle state, similar to the ones exposed
-      on the <interfacename>Manager</interfacename> object, but specific for this seat.</para>
+      <varname>IdleSinceHintMonotonic</varname> properties encode the idle state, similarly to the ones
+      exposed on the <interfacename>Manager</interfacename> object, but specific for this seat.</para>
     </refsect2>
   </refsect1>
 
@@ -933,7 +1017,7 @@ node /org/freedesktop/login1/user/_1000 {
     <refsect2>
       <title>Methods</title>
 
-      <para><function>Terminate()</function> and <function>Kill()</function> work similar to the
+      <para><function>Terminate()</function> and <function>Kill()</function> work similarly to the
       <function>TerminateUser()</function> and <function>KillUser()</function> methods on the manager
       object.</para>
     </refsect2>
@@ -983,8 +1067,8 @@ node /org/freedesktop/login1/user/_1000 {
       user. Each structure consists of the ID and object path.</para>
 
       <para>The <varname>IdleHint</varname>, <varname>IdleSinceHint</varname>, and
-      <varname>IdleSinceHintMonotonic</varname> properties encode the idle hint state of the user, similar to
-      the <interfacename>Manager</interfacename>'s properties, but specific for this user.</para>
+      <varname>IdleSinceHintMonotonic</varname> properties encode the idle hint state of the user, similarly
+      to the <interfacename>Manager</interfacename>'s properties, but specific for this user.</para>
 
       <para>The <varname>Linger</varname> property shows whether lingering is enabled for this user.</para>
     </refsect2>
@@ -1008,6 +1092,8 @@ node /org/freedesktop/login1/session/1 {
       TakeControl(in  b force);
       ReleaseControl();
       SetType(in  s type);
+      SetDisplay(in  s display);
+      SetTTY(in  h tty_fd);
       TakeDevice(in  u major,
                  in  u minor,
                  out h fd,
@@ -1105,6 +1191,10 @@ node /org/freedesktop/login1/session/1 {
 
     <variablelist class="dbus-method" generated="True" extra-ref="SetType()"/>
 
+    <variablelist class="dbus-method" generated="True" extra-ref="SetDisplay()"/>
+
+    <variablelist class="dbus-method" generated="True" extra-ref="SetTTY()"/>
+
     <variablelist class="dbus-method" generated="True" extra-ref="TakeDevice()"/>
 
     <variablelist class="dbus-method" generated="True" extra-ref="ReleaseDevice()"/>
@@ -1201,6 +1291,16 @@ node /org/freedesktop/login1/session/1 {
       connection. This should help prevent a session from entering an inconsistent state, for example if the
       controller crashes. The only argument <varname>type</varname> is the new session type.</para>
 
+      <para><function>SetDisplay()</function> allows the display name of the graphical session to be changed. This is
+      useful if the display server is started as part of the session. It can only be called by session's current
+      controller. If <function>TakeControl()</function> has not been called, this method will fail. The only argument
+      <varname>display</varname> is the new display name.</para>
+
+      <para><function>SetTTY()</function> allows the device name of the session to be changed. This is
+      useful if the tty device is only known after authentication. It can only be called by session's
+      current controller. If <function>TakeControl()</function> has not been called, this method will fail.
+      The only argument <varname>tty_fd</varname> is a file handle to the new tty device.</para>
+
       <para><function>TakeDevice()</function> allows a session controller to get a file descriptor for a
       specific device. Pass in the major and minor numbers of the character device and
       <filename>systemd-logind</filename> will return a file descriptor for the device. Only a limited set of
@@ -1348,27 +1448,46 @@ node /org/freedesktop/login1/session/1 {
     <title>Examples</title>
 
     <example>
-      <title>Introspect <interfacename>org.freedesktop.login1.Manager</interfacename> on the bus</title>
+      <title>Introspect the logind manager on the bus</title>
 
       <programlisting>$ gdbus introspect --system --dest org.freedesktop.login1 \
   --object-path /org/freedesktop/login1
       </programlisting>
+
+      <para>or</para>
+
+      <programlisting>$ busctl introspect org.freedesktop.login1 /org/freedesktop/login1
+      </programlisting>
     </example>
 
     <example>
-      <title>Introspect <interfacename>org.freedesktop.login1.Seat</interfacename> on the bus</title>
+      <title>Introspect the default seat on the bus</title>
 
       <programlisting>$ gdbus introspect --system --dest org.freedesktop.login1 \
  --object-path /org/freedesktop/login1/seat/seat0
       </programlisting>
+
+      <para>or</para>
+
+      <programlisting>$ busctl introspect org.freedesktop.login1 /org/freedesktop/login1/seat/seat0
+      </programlisting>
+
+      <para>Seat <literal>seat0</literal> is the default seat, so it'll be present unless local configuration
+      is made to reassign all devices to a different seat. The list of seats and users can be acquired with
+      <command>loginctl list-sessions</command>.</para>
     </example>
 
     <example>
-      <title>Introspect <interfacename>org.freedesktop.login1.User</interfacename> on the bus</title>
+      <title>Introspect a single user on the bus</title>
 
       <programlisting>$ gdbus introspect --system --dest org.freedesktop.login1 \
   --object-path /org/freedesktop/login1/user/_1000
       </programlisting>
+
+      <para>or</para>
+
+      <programlisting>$ busctl introspect org.freedesktop.login1 /org/freedesktop/login1/user/_1000
+      </programlisting>
     </example>
 
     <example>
@@ -1377,13 +1496,32 @@ node /org/freedesktop/login1/session/1 {
       <programlisting>$ gdbus introspect --system --dest org.freedesktop.login1 \
   --object-path /org/freedesktop/login1/session/45
       </programlisting>
+
+      <para>or</para>
+
+      <programlisting>$ busctl introspect org.freedesktop.login1 /org/freedesktop/login1/session/45
+      </programlisting>
     </example>
   </refsect1>
 
-  <refsect1>
-    <title>Versioning</title>
+  <xi:include href="org.freedesktop.locale1.xml" xpointer="versioning"/>
 
-    <para>These D-Bus interfaces follow <ulink url="http://0pointer.de/blog/projects/versioning-dbus.html">
-    the usual interface versioning guidelines</ulink>.</para>
+  <refsect1>
+    <title>History</title>
+    <refsect2>
+      <title>The Manager Object</title>
+      <para><varname>HandlePowerKeyLongPress</varname>,
+      <varname>HandleRebootKey</varname>,
+      <varname>HandleRebootKeyLongPress</varname>,
+      <varname>HandleSuspendKeyLongPress</varname>, and
+      <varname>HandleHibernateKeyLongPress</varname> were added in version 251.</para>
+      <para><varname>StopIdleSessionUSec</varname> was added in version 252.</para>
+      <para><function>PrepareForShutdownWithMetadata</function> was added in version 255.</para>
+    </refsect2>
+    <refsect2>
+      <title>Session Objects</title>
+      <para><function>SetDisplay()</function> was added in version 252.</para>
+      <para><function>SetTTY()</function> was added in version 254.</para>
+    </refsect2>
   </refsect1>
 </refentry>