'\" t .TH "ORG\&.FREEDESKTOP\&.LOGIN1" "5" "" "systemd 256.8" "org.freedesktop.login1" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" org.freedesktop.login1 \- The D\-Bus interface of systemd\-logind .SH "INTRODUCTION" .PP \fBsystemd-logind.service\fR(8) is a system service that keeps track of user logins and seats\&. .PP The daemon provides both a C library interface as well as a D\-Bus interface\&. The library interface may be used to introspect and watch the state of user logins and seats\&. The bus interface provides the same functionality but in addition may also be used to make changes to the system state\&. For more information please consult \fBsd-login\fR(3)\&. .SH "THE MANAGER OBJECT" .PP The service exposes the following interfaces on the Manager object on the bus: .sp .if n \{\ .RS 4 .\} .nf node /org/freedesktop/login1 { interface org\&.freedesktop\&.login1\&.Manager { methods: GetSession(in s session_id, out o object_path); GetSessionByPID(in u pid, out o object_path); GetUser(in u uid, out o object_path); GetUserByPID(in u pid, out o object_path); GetSeat(in s seat_id, out o object_path); ListSessions(out a(susso) sessions); ListSessionsEx(out a(sussussbto) sessions); 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, in s type, in s class, in s desktop, in s seat_id, in u vtnr, in s tty, in s display, in b remote, in s remote_user, in s remote_host, in a(sv) properties, out s session_id, out o object_path, out s runtime_path, out h fifo_fd, out u uid, out s seat_id, out u vtnr, out b existing); @org\&.freedesktop\&.systemd1\&.Privileged("true") CreateSessionWithPIDFD(in u uid, in h pidfd, in s service, in s type, in s class, in s desktop, in s seat_id, in u vtnr, in s tty, in s display, in b remote, in s remote_user, in s remote_host, in t flags, in a(sv) properties, out s session_id, out o object_path, out s runtime_path, out h fifo_fd, out u uid, out s seat_id, out u vtnr, out b existing); ReleaseSession(in s session_id); ActivateSession(in s session_id); ActivateSessionOnSeat(in s session_id, in s seat_id); LockSession(in s session_id); UnlockSession(in s session_id); LockSessions(); UnlockSessions(); KillSession(in s session_id, in s who, in i signal_number); KillUser(in u uid, in i signal_number); TerminateSession(in s session_id); TerminateUser(in u uid); TerminateSeat(in s seat_id); SetUserLinger(in u uid, in b enable, in b interactive); AttachDevice(in s seat_id, in s sysfs_path, 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); Sleep(in t flags); CanPowerOff(out s result); CanReboot(out s result); CanHalt(out s result); CanSuspend(out s result); CanHibernate(out s result); CanHybridSleep(out s result); CanSuspendThenHibernate(out s result); CanSleep(out s result); ScheduleShutdown(in s type, in t usec); CancelScheduledShutdown(out b cancelled); Inhibit(in s what, in s who, in s why, in s mode, out h pipe_fd); CanRebootParameter(out s result); SetRebootParameter(in s parameter); CanRebootToFirmwareSetup(out s result); SetRebootToFirmwareSetup(in b enable); CanRebootToBootLoaderMenu(out s result); SetRebootToBootLoaderMenu(in t timeout); CanRebootToBootLoaderEntry(out s result); SetRebootToBootLoaderEntry(in s boot_loader_entry); SetWallMessage(in s wall_message, in b enable); signals: SessionNew(s session_id, o object_path); SessionRemoved(s session_id, o object_path); UserNew(u uid, o object_path); UserRemoved(u uid, o object_path); SeatNew(s seat_id, o object_path); 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\&.systemd1\&.Privileged("true") readwrite b EnableWallMessages = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") @org\&.freedesktop\&.systemd1\&.Privileged("true") readwrite s WallMessage = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly u NAutoVTs = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly as KillOnlyUsers = [\*(Aq\&.\&.\&.\*(Aq, \&.\&.\&.]; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly as KillExcludeUsers = [\*(Aq\&.\&.\&.\*(Aq, \&.\&.\&.]; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly b KillUserProcesses = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly s RebootParameter = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly b RebootToFirmwareSetup = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly t RebootToBootLoaderMenu = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly s RebootToBootLoaderEntry = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly as BootLoaderEntries = [\*(Aq\&.\&.\&.\*(Aq, \&.\&.\&.]; readonly b IdleHint = \&.\&.\&.; readonly t IdleSinceHint = \&.\&.\&.; readonly t IdleSinceHintMonotonic = \&.\&.\&.; readonly s BlockInhibited = \*(Aq\&.\&.\&.\*(Aq; readonly s DelayInhibited = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly t InhibitDelayMaxUSec = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly t UserStopDelayUSec = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly as SleepOperation = [\*(Aq\&.\&.\&.\*(Aq, \&.\&.\&.]; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s HandlePowerKey = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s HandlePowerKeyLongPress = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s HandleRebootKey = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s HandleRebootKeyLongPress = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s HandleSuspendKey = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s HandleSuspendKeyLongPress = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s HandleHibernateKey = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s HandleHibernateKeyLongPress = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s HandleLidSwitch = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s HandleLidSwitchExternalPower = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s HandleLidSwitchDocked = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly t HoldoffTimeoutUSec = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s IdleAction = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly t IdleActionUSec = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly b PreparingForShutdown = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly b PreparingForSleep = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly (st) ScheduledShutdown = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly b Docked = \&.\&.\&.; readonly b LidClosed = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly b OnExternalPower = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly b RemoveIPC = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly t RuntimeDirectorySize = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly t RuntimeDirectoryInodesMax = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly t InhibitorsMax = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly t NCurrentInhibitors = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") 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 { \&.\&.\&. }; interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. }; }; .fi .if n \{\ .RE .\} .SS "Methods" .PP \fBGetSession()\fR may be used to get the session object path for the session with the specified ID\&. Similarly, \fBGetUser()\fR and \fBGetSeat()\fR get the user and seat objects, respectively\&. \fBGetSessionByPID()\fR and \fBGetUserByPID()\fR get the session/user object the specified PID belongs to if there is any\&. .PP \fBListSessions()\fR returns an array of all current sessions\&. The structures in the array consist of the following fields: \fIsession id\fR, \fIuser id\fR, \fIuser name\fR, \fIseat id\fR, and \fIsession object path\fR\&. If a session does not have a seat attached, the seat id field will be an empty string\&. .PP \fBListSessionsEx()\fR returns an array of all current sessions with more metadata than \fBListSessions()\fR\&. The structures in the array consist of the following fields: \fIsession id\fR, \fIuser id\fR, \fIuser name\fR, \fIseat id\fR, \fIleader pid\fR, \fIsession class\fR, \fItty name\fR, \fIidle hint\fR, \fIidle hint monotonic timestamp\fR, and \fIsession object path\fR\&. \fItty\fR and \fIseat id\fR fields could be empty, if the session has no associated tty or session has no seat attached, respectively\&. .PP \fBListUsers()\fR returns an array of all currently logged in users\&. The structures in the array consist of the following fields: user id, user name, user object path\&. .PP \fBListSeats()\fR returns an array of all currently available seats\&. The structure in the array consists of the following fields: seat id, seat object path\&. .PP \fBListInhibitors()\fR lists all currently active inhibitors\&. It returns an array of structures consisting of \fIwhat\fR, \fIwho\fR, \fIwhy\fR, \fImode\fR, \fIuid\fR (user ID), and \fIpid\fR (process ID)\&. .PP \fBCreateSession()\fR, \fBCreateSessionWithPIDFD()\fR, and \fBReleaseSession()\fR may be used to open or close login sessions\&. These calls should \fInever\fR be invoked directly by clients\&. Creating/closing sessions is exclusively the job of PAM and its \fBpam_systemd\fR(8) module\&. .PP \fBActivateSession()\fR brings the session with the specified ID into the foreground\&. \fBActivateSessionOnSeat()\fR does the same, but only if the seat id matches\&. .PP \fBLockSession()\fR asks the session with the specified ID to activate the screen lock\&. \fBUnlockSession()\fR asks the session with the specified ID to remove an active screen lock, if there is any\&. This is implemented by sending out the Lock() and Unlock() signals from the respective session object which session managers are supposed to listen on\&. .PP \fBLockSessions()\fR asks all sessions to activate their screen locks\&. This may be used to lock access to the entire machine in one action\&. Similarly, \fBUnlockSessions()\fR asks all sessions to deactivate their screen locks\&. .PP \fBKillSession()\fR may be used to send a Unix signal to one or all processes of a session\&. As arguments it takes the session id, either the string "leader" or "all" and a signal number\&. If "leader" is passed only the session "leader" is killed\&. If "all" is passed all processes of the session are killed\&. .PP \fBKillUser()\fR may be used to send a Unix signal to all processes of a user\&. As arguments it takes the user id and a signal number\&. .PP \fBTerminateSession()\fR, \fBTerminateUser()\fR, \fBTerminateSeat()\fR may be used to forcibly terminate one specific session, all processes of a user, and all sessions attached to a specific seat, respectively\&. The session, user, and seat are identified by their respective IDs\&. .PP \fBSetUserLinger()\fR enables or disables user lingering\&. If enabled, the runtime directory of a user is kept around and they may continue to run processes while logged out\&. If disabled, the runtime directory goes away as soon as they log out\&. \fBSetUserLinger()\fR expects three arguments: the UID, a boolean whether to enable/disable and a boolean controlling the \m[blue]\fBpolkit\fR\m[]\&\s-2\u[1]\d\s+2 authorization interactivity (see below)\&. Note that the user linger state is persistently stored on disk\&. .PP \fBAttachDevice()\fR may be used to assign a specific device to a specific seat\&. The device is identified by its /sys/ path and must be eligible for seat assignments\&. \fBAttachDevice()\fR takes three arguments: the seat id, the sysfs path, and a boolean for controlling polkit interactivity (see below)\&. Device assignments are persistently stored on disk\&. To create a new seat, simply specify a previously unused seat id\&. For more information about the seat assignment logic see \fBsd-login\fR(3)\&. .PP \fBFlushDevices()\fR removes all explicit seat assignments for devices, resetting all assignments to the automatic defaults\&. The only argument it takes is the polkit interactivity boolean (see below)\&. .PP \fBPowerOff()\fR, \fBReboot()\fR, \fBHalt()\fR, \fBSuspend()\fR, and \fBHibernate()\fR 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)\&. \fBHybridSleep()\fR results in the system entering a hybrid\-sleep mode, i\&.e\&. the system is both hibernated and suspended\&. \fBSuspendThenHibernate()\fR results in the system being suspended, then later woken using an RTC timer and hibernated\&. The only argument is the polkit interactivity boolean \fIinteractive\fR (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\&. \fBSleep()\fR automatically selects the most suitable sleep operation supported by the machine\&. The candidate sleep operations to check for support can be configured through \fISleepOperation=\fR setting in \fBlogind.conf\fR(5)\&. UIs should expose these calls as the primary mechanism to poweroff/reboot/suspend/hibernate the machine\&. Methods \fBPowerOffWithFlags()\fR, \fBRebootWithFlags()\fR, \fBHaltWithFlags()\fR, \fBSuspendWithFlags()\fR, \fBHibernateWithFlags()\fR, \fBHybridSleepWithFlags()\fR, \fBSuspendThenHibernateWithFlags()\fR, and \fBSleep()\fR take \fIflags\fR to allow for extendability, defined as follows: .sp .if n \{\ .RS 4 .\} .nf #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) #define SD_LOGIND_SOFT_REBOOT_IF_NEXTROOT_SET_UP (UINT64_C(1) << 3) .fi .if n \{\ .RE .\} .PP When the \fIflags\fR is 0 then these methods behave just like the versions without flags\&. When \fBSD_LOGIND_ROOT_CHECK_INHIBITORS\fR (0x01) is set, active inhibitors are honoured for privileged users too\&. When \fBSD_LOGIND_KEXEC_REBOOT\fR (0x02) is set, then \fBRebootWithFlags()\fR performs a kexec reboot if kexec kernel is loaded\&. When \fBSD_LOGIND_SOFT_REBOOT\fR (0x04) is set, or \fBSD_LOGIND_SOFT_REBOOT_IF_NEXTROOT_SET_UP\fR (0x08) is set and a new root file system has been set up on "/run/nextroot/", then \fBRebootWithFlags()\fR performs a userspace reboot only\&. \fBSD_LOGIND_SOFT_REBOOT_IF_NEXTROOT_SET_UP\fR and \fBSD_LOGIND_KEXEC_REBOOT\fR can be combined, with soft\-reboot having precedence\&. .PP \fBSetRebootParameter()\fR sets a parameter for a subsequent reboot operation\&. See the description of \fBreboot\fR in \fBsystemctl\fR(1) and \fBreboot\fR(2) for more information\&. .PP \fBSetRebootToFirmwareSetup()\fR, \fBSetRebootToBootLoaderMenu()\fR, and \fBSetRebootToBootLoaderEntry()\fR configure the action to be taken from the boot loader after a reboot: respectively entering firmware setup mode, the boot loader menu, or a specific boot loader entry\&. See \fBsystemctl\fR(1) for the corresponding command line interface\&. .PP \fBCanPowerOff()\fR, \fBCanReboot()\fR, \fBCanHalt()\fR, \fBCanSuspend()\fR, \fBCanHibernate()\fR, \fBCanHybridSleep()\fR, \fBCanSuspendThenHibernate()\fR, \fBCanSleep()\fR, \fBCanRebootParameter()\fR, \fBCanRebootToFirmwareSetup()\fR, \fBCanRebootToBootLoaderMenu()\fR, and \fBCanRebootToBootLoaderEntry()\fR test whether the system supports the respective operation and whether the calling user is allowed to execute it\&. Returns one of "na", "yes", "no", and "challenge"\&. If "na" is returned, the operation is not available because hardware, kernel, or drivers do not support it\&. If "yes" is returned, the operation is supported and the user may execute the operation without further authentication\&. If "no" is returned, the operation is available but the user is not allowed to execute the operation\&. If "challenge" is returned, the operation is available but only after authorization\&. .PP \fBScheduleShutdown()\fR schedules a shutdown operation \fItype\fR at time \fIusec\fR in microseconds since the UNIX epoch\&. \fItype\fR can be one of "poweroff", "dry\-poweroff", "reboot", "dry\-reboot", "halt", and "dry\-halt"\&. (The "dry\-" variants do not actually execute the shutdown action\&.) \fBCancelScheduledShutdown()\fR cancels a scheduled shutdown\&. The output parameter \fIcancelled\fR is true if a shutdown operation was scheduled\&. .PP \fBSetWallMessage()\fR sets the wall message (the message that will be sent out to all terminals and stored in a \fButmp\fR(5) record) for a subsequent scheduled shutdown operation\&. The parameter \fIwall_message\fR specifies the shutdown reason (and may be empty) which will be included in the shutdown message\&. The parameter \fIenable\fR specifies whether to print a wall message on shutdown\&. .PP \fBInhibit()\fR creates an inhibition lock\&. It takes four parameters: \fIwhat\fR, \fIwho\fR, \fIwhy\fR, and \fImode\fR\&. \fIwhat\fR is one or more of "shutdown", "sleep", "idle", "handle\-power\-key", "handle\-suspend\-key", "handle\-hibernate\-key", "handle\-lid\-switch", separated by colons, for inhibiting poweroff/reboot, suspend/hibernate, the automatic idle logic, or hardware key handling\&. \fIwho\fR should be a short human readable string identifying the application taking the lock\&. \fIwhy\fR should be a short human readable string identifying the reason why the lock is taken\&. Finally, \fImode\fR is either "block" or "delay" which encodes 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 \m[blue]\fBInhibitor Locks\fR\m[]\&\s-2\u[2]\d\s+2\&. .SS "Signals" .PP Whenever the inhibition state or idle hint changes, \fBPropertyChanged\fR signals are sent out to which clients can subscribe\&. .PP The \fBSessionNew()\fR, \fBSessionRemoved()\fR, \fBUserNew()\fR, \fBUserRemoved()\fR, \fBSeatNew()\fR, and \fBSeatRemoved()\fR signals are sent each time a session is created or removed, a user logs in or out, or a seat is added or removed\&. They each contain the ID of the object plus the object path\&. .PP The \fBPrepareForShutdown()\fR, \fBPrepareForShutdownWithMetadata()\fR, and \fBPrepareForSleep()\fR signals are sent right before (with the argument "true") or after (with the argument "false") 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 \m[blue]\fBInhibitor Locks\fR\m[]\&\s-2\u[2]\d\s+2\&. The \fBPrepareForShutdownWithMetadata()\fR signal additionally sends a list of key/value pair metadata fields\&. Currently it sends a \fItype\fR string which defines the type of shutdown\&. The type can be one of "power\-off", "reboot", "halt", "kexec" or "soft\-reboot"\&. This signal is sent first, followed by \fBPrepareForShutdown()\fR (for backward compatibility)\&. .SS "Properties" .PP Most properties simply reflect the configuration, see \fBlogind.conf\fR(5)\&. This includes: \fINAutoVTs\fR, \fIKillOnlyUsers\fR, \fIKillExcludeUsers\fR, \fIKillUserProcesses\fR, \fIIdleAction\fR, \fIInhibitDelayMaxUSec\fR, \fIInhibitorsMax\fR, \fIUserStopDelayUSec\fR, \fIHandlePowerKey\fR, \fIHandleSuspendKey\fR, \fIHandleHibernateKey\fR, \fIHandleLidSwitch\fR, \fIHandleLidSwitchExternalPower\fR, \fIHandleLidSwitchDocked\fR, \fIIdleActionUSec\fR, \fIHoldoffTimeoutUSec\fR, \fIRemoveIPC\fR, \fIRuntimeDirectorySize\fR, \fIRuntimeDirectoryInodesMax\fR, \fIInhibitorsMax\fR, and \fISessionsMax\fR\&. .PP The \fIIdleHint\fR property reflects the idle hint state of the system\&. If the system is idle it might get into automatic suspend or shutdown depending on the configuration\&. .PP \fIIdleSinceHint\fR and \fIIdleSinceHintMonotonic\fR encode the timestamps of the last change of the idle hint boolean, in \fBCLOCK_REALTIME\fR and \fBCLOCK_MONOTONIC\fR timestamps, respectively, in microseconds since the epoch\&. .PP The \fIBlockInhibited\fR and \fIDelayInhibited\fR properties encode the currently active locks of the respective modes\&. They are colon separated lists of "shutdown", "sleep", and "idle" (see above)\&. .PP \fINCurrentSessions\fR and \fINCurrentInhibitors\fR contain the number of currently registered sessions and inhibitors\&. .PP The \fIBootLoaderEntries\fR property contains a list of boot loader entries\&. This includes boot loader entries defined in configuration and any additional loader entries reported by the boot loader\&. See \fBsystemd-boot\fR(7) for more information\&. .PP The \fIPreparingForShutdown\fR and \fIPreparingForSleep\fR boolean properties are true during the interval between the two \fBPrepareForShutdown()\fR and \fBPrepareForSleep()\fR signals respectively\&. Note that these properties do not send out \fBPropertyChanged\fR signals\&. .PP The \fIRebootParameter\fR property shows the value set with the \fBSetRebootParameter()\fR method described above\&. .PP \fIScheduledShutdown\fR shows the value pair set with the \fBScheduleShutdown()\fR method described above\&. .PP \fIRebootToFirmwareSetup\fR, \fIRebootToBootLoaderMenu\fR, and \fIRebootToBootLoaderEntry\fR are true when the resprective post\-reboot operation was selected with \fBSetRebootToFirmwareSetup()\fR, \fBSetRebootToBootLoaderMenu()\fR, or \fBSetRebootToBootLoaderEntry()\fR\&. .PP The \fIWallMessage\fR and \fIEnableWallMessages\fR properties reflect the shutdown reason and wall message enablement switch which can be set with the \fBSetWallMessage()\fR method described above\&. .PP \fIDocked\fR is true if the machine is connected to a dock\&. \fILidClosed\fR is true when the lid (of a laptop) is closed\&. \fIOnExternalPower\fR is true when the machine is connected to an external power supply\&. .SS "Security" .PP A number of operations are protected via the polkit privilege system\&. \fBSetUserLinger()\fR requires the org\&.freedesktop\&.login1\&.set\-user\-linger privilege\&. \fBAttachDevice()\fR requires org\&.freedesktop\&.login1\&.attach\-device and \fBFlushDevices()\fR requires org\&.freedesktop\&.login1\&.flush\-devices\&. \fBPowerOff()\fR, \fBReboot()\fR, \fBHalt()\fR, \fBSuspend()\fR, \fBHibernate()\fR require org\&.freedesktop\&.login1\&.power\-off, org\&.freedesktop\&.login1\&.power\-off\-multiple\-sessions, org\&.freedesktop\&.login1\&.power\-off\-ignore\-inhibit, org\&.freedesktop\&.login1\&.reboot, org\&.freedesktop\&.login1\&.reboot\-multiple\-sessions, org\&.freedesktop\&.login1\&.reboot\-ignore\-inhibit, org\&.freedesktop\&.login1\&.halt, org\&.freedesktop\&.login1\&.halt\-multiple\-sessions, org\&.freedesktop\&.login1\&.halt\-ignore\-inhibit, org\&.freedesktop\&.login1\&.suspend, org\&.freedesktop\&.login1\&.suspend\-multiple\-sessions, org\&.freedesktop\&.login1\&.suspend\-ignore\-inhibit, org\&.freedesktop\&.login1\&.hibernate, org\&.freedesktop\&.login1\&.hibernate\-multiple\-sessions, org\&.freedesktop\&.login1\&.hibernate\-ignore\-inhibit, respectively depending on whether there are other sessions around or active inhibits are present\&. \fBHybridSleep()\fR and \fBSuspendThenHibernate()\fR use the same privileges as \fBHibernate()\fR\&. \fBSleep()\fR uses the inhibits of the auto\-selected sleep operation\&. \fBSetRebootParameter()\fR requires org\&.freedesktop\&.login1\&.set\-reboot\-parameter\&. .PP \fBSetRebootToFirmwareSetup()\fR requires org\&.freedesktop\&.login1\&.set\-reboot\-to\-firmware\-setup\&. \fBSetRebootToBootLoaderMenu()\fR requires org\&.freedesktop\&.login1\&.set\-reboot\-to\-boot\-loader\-menu\&. \fBSetRebootToBootLoaderEntry()\fR requires org\&.freedesktop\&.login1\&.set\-reboot\-to\-boot\-loader\-entry\&. .PP \fBScheduleShutdown()\fR and \fBCancelScheduledShutdown()\fR require the same privileges (listed above) as the immediate poweroff/reboot/halt operations\&. .PP \fBInhibit()\fR is protected via one of org\&.freedesktop\&.login1\&.inhibit\-block\-shutdown, org\&.freedesktop\&.login1\&.inhibit\-delay\-shutdown, org\&.freedesktop\&.login1\&.inhibit\-block\-sleep, org\&.freedesktop\&.login1\&.inhibit\-delay\-sleep, org\&.freedesktop\&.login1\&.inhibit\-block\-idle, org\&.freedesktop\&.login1\&.inhibit\-handle\-power\-key, org\&.freedesktop\&.login1\&.inhibit\-handle\-suspend\-key, org\&.freedesktop\&.login1\&.inhibit\-handle\-hibernate\-key, org\&.freedesktop\&.login1\&.inhibit\-handle\-lid\-switch depending on the lock type and mode taken\&. .PP The \fIinteractive\fR boolean parameters can be used to control whether polkit should interactively ask the user for authentication credentials if required\&. .SH "SEAT OBJECTS" .sp .if n \{\ .RS 4 .\} .nf node /org/freedesktop/login1/seat/seat0 { interface org\&.freedesktop\&.login1\&.Seat { methods: Terminate(); ActivateSession(in s session_id); SwitchTo(in u vtnr); SwitchToNext(); SwitchToPrevious(); properties: @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s Id = \*(Aq\&.\&.\&.\*(Aq; readonly (so) ActiveSession = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly b CanTTY = \&.\&.\&.; readonly b CanGraphical = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly a(so) Sessions = [\&.\&.\&.]; readonly b IdleHint = \&.\&.\&.; readonly t IdleSinceHint = \&.\&.\&.; readonly t IdleSinceHintMonotonic = \&.\&.\&.; }; interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. }; interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. }; interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. }; }; .fi .if n \{\ .RE .\} .SS "Methods" .PP \fBTerminate()\fR and \fBActivateSession()\fR work similarly to \fBTerminateSeat()\fR and \fBActivationSessionOnSeat()\fR on the Manager object\&. .PP \fBSwitchTo()\fR switches to the session on the virtual terminal \fIvtnr\fR\&. \fBSwitchToNext()\fR and \fBSwitchToPrevious()\fR switch to, respectively, the next and previous sessions on the seat in the order of virtual terminals\&. If there is no active session, they switch to, respectively, the first and last session on the seat\&. .SS "Signals" .PP Whenever \fBActiveSession\fR, \fBSessions\fR, \fBCanGraphical\fR, \fBCanTTY\fR, or the idle state changes, \fBPropertyChanged\fR signals are sent out to which clients can subscribe\&. .SS "Properties" .PP The \fIId\fR property encodes the ID of the seat\&. .PP \fIActiveSession\fR encodes the currently active session if there is one\&. It is a structure consisting of the session id and the object path\&. .PP \fICanTTY\fR encodes whether the session is suitable for text logins, and \fICanGraphical\fR whether it is suitable for graphical sessions\&. .PP The \fISessions\fR property is an array of all current sessions of this seat, each encoded in a structure consisting of the ID and the object path\&. .PP The \fIIdleHint\fR, \fIIdleSinceHint\fR, and \fIIdleSinceHintMonotonic\fR properties encode the idle state, similarly to the ones exposed on the Manager object, but specific for this seat\&. .SH "USER OBJECTS" .sp .if n \{\ .RS 4 .\} .nf node /org/freedesktop/login1/user/_1000 { interface org\&.freedesktop\&.login1\&.User { methods: Terminate(); Kill(in i signal_number); properties: @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly u UID = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly u GID = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s Name = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly t Timestamp = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly t TimestampMonotonic = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s RuntimePath = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s Service = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s Slice = \*(Aq\&.\&.\&.\*(Aq; readonly (so) Display = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly s State = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly a(so) Sessions = [\&.\&.\&.]; readonly b IdleHint = \&.\&.\&.; readonly t IdleSinceHint = \&.\&.\&.; readonly t IdleSinceHintMonotonic = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false") readonly b Linger = \&.\&.\&.; }; interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. }; interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. }; interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. }; }; .fi .if n \{\ .RE .\} .SS "Methods" .PP \fBTerminate()\fR and \fBKill()\fR work similarly to the \fBTerminateUser()\fR and \fBKillUser()\fR methods on the manager object\&. .SS "Signals" .PP Whenever \fISessions\fR or the idle state changes, \fBPropertyChanged\fR signals are sent out to which clients can subscribe\&. .SS "Properties" .PP The \fIUID\fR and \fIGID\fR properties encode the Unix UID and primary GID of the user\&. .PP The \fIName\fR property encodes the user name\&. .PP \fITimestamp\fR and \fITimestampMonotonic\fR encode the login time of the user in microseconds since the epoch, in the \fBCLOCK_REALTIME\fR and \fBCLOCK_MONOTONIC\fR clocks, respectively\&. .PP \fIRuntimePath\fR encodes the runtime path of the user, i\&.e\&. \fI$XDG_RUNTIME_DIR\fR\&. For details see the \m[blue]\fBXDG Basedir Specification\fR\m[]\&\s-2\u[3]\d\s+2\&. .PP \fIService\fR contains the unit name of the user systemd service of this user\&. Each logged in user is assigned a user service that runs a user systemd instance\&. This is usually an instance of user@\&.service\&. .PP \fISlice\fR contains the unit name of the user systemd slice of this user\&. Each logged in user gets a private slice\&. .PP \fIDisplay\fR encodes which graphical session should be used as the primary UI display for the user\&. It is a structure encoding the session ID and the object path of the session to use\&. .PP \fIState\fR encodes the user state and is one of "offline", "lingering", "online", "active", or "closing"\&. See \fBsd_uid_get_state\fR(3) for more information about the states\&. .PP \fISessions\fR is an array of structures encoding all current sessions of the user\&. Each structure consists of the ID and object path\&. .PP The \fIIdleHint\fR, \fIIdleSinceHint\fR, and \fIIdleSinceHintMonotonic\fR properties encode the idle hint state of the user, similarly to the Manager\*(Aqs properties, but specific for this user\&. .PP The \fILinger\fR property shows whether lingering is enabled for this user\&. .SH "SESSION OBJECTS" .sp .if n \{\ .RS 4 .\} .nf node /org/freedesktop/login1/session/1 { interface org\&.freedesktop\&.login1\&.Session { methods: Terminate(); Activate(); Lock(); Unlock(); SetIdleHint(in b idle); SetLockedHint(in b locked); Kill(in s who, in i signal_number); TakeControl(in b force); ReleaseControl(); SetType(in s type); SetClass(in s class); SetDisplay(in s display); SetTTY(in h tty_fd); TakeDevice(in u major, in u minor, out h fd, out b inactive); ReleaseDevice(in u major, in u minor); PauseDeviceComplete(in u major, in u minor); SetBrightness(in s subsystem, in s name, in u brightness); signals: PauseDevice(u major, u minor, s type); ResumeDevice(u major, u minor, h fd); Lock(); Unlock(); properties: @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s Id = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly (uo) User = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s Name = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly t Timestamp = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly t TimestampMonotonic = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly u VTNr = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly (so) Seat = \&.\&.\&.; readonly s TTY = \*(Aq\&.\&.\&.\*(Aq; readonly s Display = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly b Remote = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s RemoteHost = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s RemoteUser = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s Service = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s Desktop = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly s Scope = \*(Aq\&.\&.\&.\*(Aq; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly u Leader = \&.\&.\&.; @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const") readonly u Audit = \&.\&.\&.; readonly s Type = \*(Aq\&.\&.\&.\*(Aq; readonly s Class = \*(Aq\&.\&.\&.\*(Aq; readonly b Active = \&.\&.\&.; readonly s State = \*(Aq\&.\&.\&.\*(Aq; readonly b IdleHint = \&.\&.\&.; readonly t IdleSinceHint = \&.\&.\&.; readonly t IdleSinceHintMonotonic = \&.\&.\&.; readonly b LockedHint = \&.\&.\&.; }; interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. }; interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. }; interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. }; }; .fi .if n \{\ .RE .\} .SS "Methods" .PP \fBTerminate()\fR, \fBActivate()\fR, \fBLock()\fR, \fBUnlock()\fR, and \fBKill()\fR work similarly to the respective calls on the Manager object\&. .PP \fBSetIdleHint()\fR is called by the session object to update the idle state of the session whenever it changes\&. .PP \fBTakeControl()\fR allows a process to take exclusive managed device access\-control for that session\&. Only one D\-Bus connection can be a controller for a given session at any time\&. If the \fIforce\fR argument is set (root only), an existing controller is kicked out and replaced\&. Otherwise, this method fails if there is already a controller\&. Note that this method is limited to D\-Bus users with the effective UID set to the user of the session or root\&. .PP \fBReleaseControl()\fR drops control of a given session\&. Closing the D\-Bus connection implicitly releases control as well\&. See \fBTakeControl()\fR for more information\&. This method also releases all devices for which the controller requested ownership via \fBTakeDevice()\fR\&. .PP \fBSetType()\fR allows the type of the session to be changed dynamically\&. It can only be called by session\*(Aqs current controller\&. If \fBTakeControl()\fR has not been called, this method will fail\&. In addition, the session type will be reset to its original value once control is released, either by calling \fBReleaseControl()\fR or closing the D\-Bus connection\&. This should help prevent a session from entering an inconsistent state, for example if the controller crashes\&. The only argument \fItype\fR is the new session type\&. .PP \fBSetClass()\fR allows the caller to change the class of the session dynamically\&. It may only be called by session\*(Aqs owening user\&. Currently, this call may be exclusively used to change the class from "user\-incomplete" to "user"\&. The call is synchronous, and will return only once the user\*(Aqs service manager has successfully been started, if necessary\&. The only argument \fItype\fR is the new session type\&. .PP \fBSetDisplay()\fR 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\*(Aqs current controller\&. If \fBTakeControl()\fR has not been called, this method will fail\&. The only argument \fIdisplay\fR is the new display name\&. .PP \fBSetTTY()\fR 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\*(Aqs current controller\&. If \fBTakeControl()\fR has not been called, this method will fail\&. The only argument \fItty_fd\fR is a file handle to the new tty device\&. .PP \fBTakeDevice()\fR 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 systemd\-logind will return a file descriptor for the device\&. Only a limited set of device\-types is currently supported (but may be extended)\&. systemd\-logind automatically mutes the file descriptor if the session is inactive and resumes it once the session is activated again\&. This guarantees that a session can only access session devices if the session is active\&. Note that this revoke/resume mechanism is asynchronous and may happen at any given time\&. This only works on devices that are attached to the seat of the given session\&. A process is not required to have direct access to the device node\&. systemd\-logind only requires you to be the active session controller (see \fBTakeControl()\fR)\&. Also note that any device can only be requested once\&. As long as you don\*(Aqt release it, further \fBTakeDevice()\fR calls will fail\&. .PP \fBReleaseDevice()\fR releases a device again (see \fBTakeDevice()\fR)\&. This is also implicitly done by \fBReleaseControl()\fR or when closing the D\-Bus connection\&. .PP \fBPauseDeviceComplete()\fR allows a session controller to synchronously pause a device after receiving a \fBPauseDevice(\fR\fB"pause"\fR\fB)\fR signal\&. Forced signals (or after an internal timeout) are automatically completed by systemd\-logind asynchronously\&. .PP \fBSetLockedHint()\fR may be used to set the "locked hint" to \fIlocked\fR, i\&.e\&. information whether the session is locked\&. This is intended to be used by the desktop environment to tell \fBsystemd\-logind\fR when the session is locked and unlocked\&. .PP \fBSetBrightness()\fR may be used to set the display brightness\&. This is intended to be used by the desktop environment and allows unprivileged programs to access hardware settings in a controlled way\&. The \fIsubsystem\fR parameter specifies a kernel subsystem, either "backlight" or "leds"\&. The \fIname\fR parameter specifies a device name under the specified subsystem\&. The \fIbrightness\fR parameter specifies the brightness\&. The range is defined by individual drivers, see /sys/class/\fIsubsystem\fR/\fIname\fR/max_brightness\&. .SS "Signals" .PP The active session controller exclusively gets \fBPauseDevice()\fR and \fBResumeDevice()\fR events for any device it requested via \fBTakeDevice()\fR\&. They notify the controller whenever a device is paused or resumed\&. A device is never resumed if its session is inactive\&. Also note that \fBPauseDevice()\fR signals are sent before the \fBPropertyChanged\fR signal for the \fBActive\fR state\&. The inverse is true for \fBResumeDevice()\fR\&. A device may remain paused for unknown reasons even though the Session is active\&. .PP A \fBPauseDevice()\fR signal carries the major and minor numbers and a string describing the type as arguments\&. \fBforce\fR means the device was already paused by systemd\-logind and the signal is only an asynchronous notification\&. \fBpause\fR means systemd\-logind grants you a limited amount of time to pause the device\&. You must respond to this via \fBPauseDeviceComplete()\fR\&. This synchronous pausing mechanism is used for backwards\-compatibility to VTs and systemd\-logind is free to not make use of it\&. It is also free to send a forced \fBPauseDevice()\fR if you don\*(Aqt respond in a timely manner (or for any other reason)\&. \fBgone\fR means the device was unplugged from the system and you will no longer get any notifications about it\&. There is no need to call \fBReleaseDevice()\fR\&. You may call \fBTakeDevice()\fR again if a new device is assigned the major+minor combination\&. .PP \fBResumeDevice()\fR is sent whenever a session is active and a device is resumed\&. It carries the major/minor numbers as arguments and provides a new open file descriptor\&. You should switch to the new descriptor and close the old one\&. They are not guaranteed to have the same underlying open file descriptor in the kernel (except for a limited set of device types)\&. .PP Whenever \fBActive\fR or the idle state changes, \fBPropertyChanged\fR signals are sent out to which clients can subscribe\&. .PP \fBLock()\fR/\fBUnlock()\fR is sent when the session is asked to be screen\-locked/unlocked\&. A session manager of the session should listen to this signal and act accordingly\&. This signal is sent out as a result of the \fBLock()\fR and \fBUnlock()\fR methods, respectively\&. .SS "Properties" .PP \fIId\fR encodes the session ID\&. .PP \fIUser\fR encodes the user ID of the user this session belongs to\&. This is a structure consisting of the Unix UID and the object path\&. .PP \fIName\fR encodes the user name\&. .PP \fITimestamp\fR and \fITimestampMonotonic\fR encode the microseconds since the epoch when the session was created, in \fBCLOCK_REALTIME\fR or \fBCLOCK_MONOTONIC\fR, respectively\&. .PP \fIVTNr\fR encodes the virtual terminal number of the session if there is any, 0 otherwise\&. .PP \fISeat\fR encodes the seat this session belongs to if there is any\&. This is a structure consisting of the ID and the seat object path\&. .PP \fITTY\fR encodes the kernel TTY path of the session if this is a text login\&. If not this is an empty string\&. .PP \fIDisplay\fR encodes the X11 display name if this is a graphical login\&. If not, this is an empty string\&. .PP \fIRemote\fR encodes whether the session is local or remote\&. .PP \fIRemoteHost\fR and \fIRemoteUser\fR encode the remote host and user if this is a remote session, or an empty string otherwise\&. .PP \fIService\fR encodes the PAM service name that registered the session\&. .PP \fIDesktop\fR describes the desktop environment running in the session (if known)\&. .PP \fIScope\fR contains the systemd scope unit name of this session\&. .PP \fILeader\fR encodes the PID of the process that registered the session\&. .PP \fIAudit\fR encodes the Kernel Audit session ID of the session if auditing is available\&. .PP \fIType\fR encodes the session type\&. It\*(Aqs one of "unspecified" (for cron PAM sessions and suchlike), "tty" (for text logins) or "x11"/"mir"/"wayland" (for graphical logins)\&. .PP \fIClass\fR encodes the session class\&. It\*(Aqs one of "user" (for normal user sessions), "greeter" (for display manager pseudo\-sessions), or "lock\-screen" (for display lock screens)\&. .PP \fIActive\fR is a boolean that is true if the session is active, i\&.e\&. currently in the foreground\&. This field is semi\-redundant due to \fIState\fR\&. .PP \fIState\fR encodes the session state and one of "online", "active", or "closing"\&. See \fBsd_session_get_state\fR(3) for more information about the states\&. .PP \fIIdleHint\fR, \fIIdleSinceHint\fR, and \fIIdleSinceHintMonotonic\fR encapsulate the idle hint state of this session, similarly to how the respective properties on the manager object do it for the whole system\&. .PP \fILockedHint\fR shows the locked hint state of this session, as set by the \fBSetLockedHint()\fR method described above\&. .SH "EXAMPLES" .PP \fBExample\ \&1.\ \&Introspect the logind manager on the bus\fR .sp .if n \{\ .RS 4 .\} .nf $ gdbus introspect \-\-system \-\-dest org\&.freedesktop\&.login1 \e \-\-object\-path /org/freedesktop/login1 .fi .if n \{\ .RE .\} .PP or .sp .if n \{\ .RS 4 .\} .nf $ busctl introspect org\&.freedesktop\&.login1 /org/freedesktop/login1 .fi .if n \{\ .RE .\} .PP \fBExample\ \&2.\ \&Introspect the default seat on the bus\fR .sp .if n \{\ .RS 4 .\} .nf $ gdbus introspect \-\-system \-\-dest org\&.freedesktop\&.login1 \e \-\-object\-path /org/freedesktop/login1/seat/seat0 .fi .if n \{\ .RE .\} .PP or .sp .if n \{\ .RS 4 .\} .nf $ busctl introspect org\&.freedesktop\&.login1 /org/freedesktop/login1/seat/seat0 .fi .if n \{\ .RE .\} .PP Seat "seat0" is the default seat, so it\*(Aqll 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 \fBloginctl list\-sessions\fR\&. .PP \fBExample\ \&3.\ \&Introspect a single user on the bus\fR .sp .if n \{\ .RS 4 .\} .nf $ gdbus introspect \-\-system \-\-dest org\&.freedesktop\&.login1 \e \-\-object\-path /org/freedesktop/login1/user/_1000 .fi .if n \{\ .RE .\} .PP or .sp .if n \{\ .RS 4 .\} .nf $ busctl introspect org\&.freedesktop\&.login1 /org/freedesktop/login1/user/_1000 .fi .if n \{\ .RE .\} .PP \fBExample\ \&4.\ \&Introspect org\&.freedesktop\&.login1\&.Session on the bus\fR .sp .if n \{\ .RS 4 .\} .nf $ gdbus introspect \-\-system \-\-dest org\&.freedesktop\&.login1 \e \-\-object\-path /org/freedesktop/login1/session/45 .fi .if n \{\ .RE .\} .PP or .sp .if n \{\ .RS 4 .\} .nf $ busctl introspect org\&.freedesktop\&.login1 /org/freedesktop/login1/session/45 .fi .if n \{\ .RE .\} .SH "VERSIONING" .PP These D\-Bus interfaces follow \m[blue]\fBthe usual interface versioning guidelines\fR\m[]\&\s-2\u[4]\d\s+2\&. .SH "HISTORY" .SS "The Manager Object" .PP \fIHandlePowerKeyLongPress\fR, \fIHandleRebootKey\fR, \fIHandleRebootKeyLongPress\fR, \fIHandleSuspendKeyLongPress\fR, and \fIHandleHibernateKeyLongPress\fR were added in version 251\&. .PP \fIStopIdleSessionUSec\fR was added in version 252\&. .PP \fBPrepareForShutdownWithMetadata()\fR and \fBCreateSessionWithPIDFD()\fR were added in version 255\&. .PP \fBSleep()\fR, \fBCanSleep()\fR, \fISleepOperation\fR, and \fBListSessionsEx()\fR were added in version 256\&. .SS "Session Objects" .PP \fBSetDisplay()\fR was added in version 252\&. .PP \fBSetTTY()\fR was added in version 254\&. .PP \fBSetClass()\fR was added in version 256\&. .SH "SEE ALSO" .PP \fBsystemd\fR(1), \fBsystemd-logind.service\fR(8), \fBloginctl\fR(1) .SH "NOTES" .IP " 1." 4 polkit .RS 4 \%https://www.freedesktop.org/software/polkit/docs/latest/ .RE .IP " 2." 4 Inhibitor Locks .RS 4 \%https://systemd.io/INHIBITOR_LOCKS .RE .IP " 3." 4 XDG Basedir Specification .RS 4 \%https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html .RE .IP " 4." 4 the usual interface versioning guidelines .RS 4 \%https://0pointer.de/blog/projects/versioning-dbus.html .RE