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,
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,
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")
@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 = '...';
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 { ... };
};
</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"/>
<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"/>
<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"/>
<variablelist class="dbus-property" generated="True" extra-ref="NCurrentSessions"/>
+ <variablelist class="dbus-property" generated="True" extra-ref="StopIdleSessionUSec"/>
+
<!--End of Autogenerated section-->
<refsect2>
<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 for non-privileged users. UIs should expose these calls
- as the primary mechanism to poweroff/reboot/suspend/hibernate the machine. Methods
+ 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
extendability, defined as follows:</para>
<programlisting>
#define SD_LOGIND_ROOT_CHECK_INHIBITORS (UINT64_C(1) << 0)
+#define SD_LOGIND_KEXEC_REBOOT (UINT64_C(1) << 1)
+#define SD_LOGIND_SOFT_REBOOT (UINT64_C(1) << 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.</para>
+ <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
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>
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>
<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
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>
<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>
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>
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,
<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()"/>
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
<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>
<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>