1ORG.FREEDESKTOP.LOGIN1(5)   org.freedesktop.login1   ORG.FREEDESKTOP.LOGIN1(5)
2
3
4

NAME

6       org.freedesktop.login1 - The D-Bus interface of systemd-logind
7

INTRODUCTION

9       systemd-logind.service(8) is a system service that keeps track of user
10       logins and seats.
11
12       The daemon provides both a C library interface as well as a D-Bus
13       interface. The library interface may be used to introspect and watch
14       the state of user logins and seats. The bus interface provides the same
15       functionality but in addition may also be used to make changes to the
16       system state. For more information please consult sd-login(3).
17

THE MANAGER OBJECT

19       The service exposes the following interfaces on the Manager object on
20       the bus:
21
22           node /org/freedesktop/login1 {
23             interface org.freedesktop.login1.Manager {
24               methods:
25                 GetSession(in  s session_id,
26                            out o object_path);
27                 GetSessionByPID(in  u pid,
28                                 out o object_path);
29                 GetUser(in  u uid,
30                         out o object_path);
31                 GetUserByPID(in  u pid,
32                              out o object_path);
33                 GetSeat(in  s seat_id,
34                         out o object_path);
35                 ListSessions(out a(susso) sessions);
36                 ListUsers(out a(uso) users);
37                 ListSeats(out a(so) seats);
38                 ListInhibitors(out a(ssssuu) inhibitors);
39                 @org.freedesktop.systemd1.Privileged("true")
40                 CreateSession(in  u uid,
41                               in  u pid,
42                               in  s service,
43                               in  s type,
44                               in  s class,
45                               in  s desktop,
46                               in  s seat_id,
47                               in  u vtnr,
48                               in  s tty,
49                               in  s display,
50                               in  b remote,
51                               in  s remote_user,
52                               in  s remote_host,
53                               in  a(sv) properties,
54                               out s session_id,
55                               out o object_path,
56                               out s runtime_path,
57                               out h fifo_fd,
58                               out u uid,
59                               out s seat_id,
60                               out u vtnr,
61                               out b existing);
62                 @org.freedesktop.systemd1.Privileged("true")
63                 ReleaseSession(in  s session_id);
64                 ActivateSession(in  s session_id);
65                 ActivateSessionOnSeat(in  s session_id,
66                                       in  s seat_id);
67                 LockSession(in  s session_id);
68                 UnlockSession(in  s session_id);
69                 LockSessions();
70                 UnlockSessions();
71                 KillSession(in  s session_id,
72                             in  s who,
73                             in  i signal_number);
74                 KillUser(in  u uid,
75                          in  i signal_number);
76                 TerminateSession(in  s session_id);
77                 TerminateUser(in  u uid);
78                 TerminateSeat(in  s seat_id);
79                 SetUserLinger(in  u uid,
80                               in  b enable,
81                               in  b interactive);
82                 AttachDevice(in  s seat_id,
83                              in  s sysfs_path,
84                              in  b interactive);
85                 FlushDevices(in  b interactive);
86                 PowerOff(in  b interactive);
87                 PowerOffWithFlags(in  t flags);
88                 Reboot(in  b interactive);
89                 RebootWithFlags(in  t flags);
90                 Halt(in  b interactive);
91                 HaltWithFlags(in  t flags);
92                 Suspend(in  b interactive);
93                 SuspendWithFlags(in  t flags);
94                 Hibernate(in  b interactive);
95                 HibernateWithFlags(in  t flags);
96                 HybridSleep(in  b interactive);
97                 HybridSleepWithFlags(in  t flags);
98                 SuspendThenHibernate(in  b interactive);
99                 SuspendThenHibernateWithFlags(in  t flags);
100                 CanPowerOff(out s result);
101                 CanReboot(out s result);
102                 CanHalt(out s result);
103                 CanSuspend(out s result);
104                 CanHibernate(out s result);
105                 CanHybridSleep(out s result);
106                 CanSuspendThenHibernate(out s result);
107                 ScheduleShutdown(in  s type,
108                                  in  t usec);
109                 CancelScheduledShutdown(out b cancelled);
110                 Inhibit(in  s what,
111                         in  s who,
112                         in  s why,
113                         in  s mode,
114                         out h pipe_fd);
115                 CanRebootParameter(out s result);
116                 SetRebootParameter(in  s parameter);
117                 CanRebootToFirmwareSetup(out s result);
118                 SetRebootToFirmwareSetup(in  b enable);
119                 CanRebootToBootLoaderMenu(out s result);
120                 SetRebootToBootLoaderMenu(in  t timeout);
121                 CanRebootToBootLoaderEntry(out s result);
122                 SetRebootToBootLoaderEntry(in  s boot_loader_entry);
123                 SetWallMessage(in  s wall_message,
124                                in  b enable);
125               signals:
126                 SessionNew(s session_id,
127                            o object_path);
128                 SessionRemoved(s session_id,
129                                o object_path);
130                 UserNew(u uid,
131                         o object_path);
132                 UserRemoved(u uid,
133                             o object_path);
134                 SeatNew(s seat_id,
135                         o object_path);
136                 SeatRemoved(s seat_id,
137                             o object_path);
138                 PrepareForShutdown(b start);
139                 PrepareForSleep(b start);
140               properties:
141                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
142                 @org.freedesktop.systemd1.Privileged("true")
143                 readwrite b EnableWallMessages = ...;
144                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
145                 @org.freedesktop.systemd1.Privileged("true")
146                 readwrite s WallMessage = '...';
147                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
148                 readonly u NAutoVTs = ...;
149                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
150                 readonly as KillOnlyUsers = ['...', ...];
151                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
152                 readonly as KillExcludeUsers = ['...', ...];
153                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
154                 readonly b KillUserProcesses = ...;
155                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
156                 readonly s RebootParameter = '...';
157                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
158                 readonly b RebootToFirmwareSetup = ...;
159                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
160                 readonly t RebootToBootLoaderMenu = ...;
161                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
162                 readonly s RebootToBootLoaderEntry = '...';
163                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
164                 readonly as BootLoaderEntries = ['...', ...];
165                 readonly b IdleHint = ...;
166                 readonly t IdleSinceHint = ...;
167                 readonly t IdleSinceHintMonotonic = ...;
168                 readonly s BlockInhibited = '...';
169                 readonly s DelayInhibited = '...';
170                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
171                 readonly t InhibitDelayMaxUSec = ...;
172                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
173                 readonly t UserStopDelayUSec = ...;
174                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
175                 readonly s HandlePowerKey = '...';
176                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
177                 readonly s HandleSuspendKey = '...';
178                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
179                 readonly s HandleHibernateKey = '...';
180                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
181                 readonly s HandleLidSwitch = '...';
182                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
183                 readonly s HandleLidSwitchExternalPower = '...';
184                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
185                 readonly s HandleLidSwitchDocked = '...';
186                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
187                 readonly t HoldoffTimeoutUSec = ...;
188                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
189                 readonly s IdleAction = '...';
190                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
191                 readonly t IdleActionUSec = ...;
192                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
193                 readonly b PreparingForShutdown = ...;
194                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
195                 readonly b PreparingForSleep = ...;
196                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
197                 readonly (st) ScheduledShutdown = ...;
198                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
199                 readonly b Docked = ...;
200                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
201                 readonly b LidClosed = ...;
202                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
203                 readonly b OnExternalPower = ...;
204                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
205                 readonly b RemoveIPC = ...;
206                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
207                 readonly t RuntimeDirectorySize = ...;
208                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
209                 readonly t RuntimeDirectoryInodesMax = ...;
210                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
211                 readonly t InhibitorsMax = ...;
212                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
213                 readonly t NCurrentInhibitors = ...;
214                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
215                 readonly t SessionsMax = ...;
216                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
217                 readonly t NCurrentSessions = ...;
218             };
219             interface org.freedesktop.DBus.Peer { ... };
220             interface org.freedesktop.DBus.Introspectable { ... };
221             interface org.freedesktop.DBus.Properties { ... };
222           };
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332   Methods
333       GetSession() may be used to get the session object path for the session
334       with the specified ID. Similarly, GetUser() and GetSeat() get the user
335       and seat objects, respectively.  GetSessionByPID() and GetUserByPID()
336       get the session/user object the specified PID belongs to if there is
337       any.
338
339       ListSessions() returns an array of all current sessions. The structures
340       in the array consist of the following fields: session id, user id, user
341       name, seat id, session object path. If a session does not have a seat
342       attached, the seat id field will be an empty string.
343
344       ListUsers() returns an array of all currently logged in users. The
345       structures in the array consist of the following fields: user id, user
346       name, user object path.
347
348       ListSeats() returns an array of all currently available seats. The
349       structure in the array consists of the following fields: seat id, seat
350       object path.
351
352       ListInhibitors() lists all currently active inhibitors. It returns an
353       array of structures consisting of what, who, why, mode, uid (user ID),
354       and pid (process ID).
355
356       CreateSession() and ReleaseSession() may be used to open or close login
357       sessions. These calls should never be invoked directly by clients.
358       Creating/closing sessions is exclusively the job of PAM and its
359       pam_systemd(8) module.
360
361       ActivateSession() brings the session with the specified ID into the
362       foreground.  ActivateSessionOnSeat() does the same, but only if the
363       seat id matches.
364
365       LockSession() asks the session with the specified ID to activate the
366       screen lock.  UnlockSession() asks the session with the specified ID to
367       remove an active screen lock, if there is any. This is implemented by
368       sending out the Lock() and Unlock() signals from the respective session
369       object which session managers are supposed to listen on.
370
371       LockSessions() asks all sessions to activate their screen locks. This
372       may be used to lock access to the entire machine in one action.
373       Similarly, UnlockSessions() asks all sessions to deactivate their
374       screen locks.
375
376       KillSession() may be used to send a Unix signal to one or all processes
377       of a session. As arguments it takes the session id, either the string
378       "leader" or "all" and a signal number. If "leader" is passed only the
379       session "leader" is killed. If "all" is passed all processes of the
380       session are killed.
381
382       KillUser() may be used to send a Unix signal to all processes of a
383       user. As arguments it takes the user id and a signal number.
384
385       TerminateSession(), TerminateUser(), TerminateSeat() may be used to
386       forcibly terminate one specific session, all processes of a user, and
387       all sessions attached to a specific seat, respectively. The session,
388       user, and seat are identified by their respective IDs.
389
390       SetUserLinger() enables or disables user lingering. If enabled, the
391       runtime directory of a user is kept around and they may continue to run
392       processes while logged out. If disabled, the runtime directory goes
393       away as soon as they log out.  SetUserLinger() expects three arguments:
394       the UID, a boolean whether to enable/disable and a boolean controlling
395       the polkit[1] authorization interactivity (see below). Note that the
396       user linger state is persistently stored on disk.
397
398       AttachDevice() may be used to assign a specific device to a specific
399       seat. The device is identified by its /sys/ path and must be eligible
400       for seat assignments.  AttachDevice() takes three arguments: the seat
401       id, the sysfs path, and a boolean for controlling polkit interactivity
402       (see below). Device assignments are persistently stored on disk. To
403       create a new seat, simply specify a previously unused seat id. For more
404       information about the seat assignment logic see sd-login(3).
405
406       FlushDevices() removes all explicit seat assignments for devices,
407       resetting all assignments to the automatic defaults. The only argument
408       it takes is the polkit interactivity boolean (see below).
409
410       PowerOff(), Reboot(), Halt(), Suspend(), and Hibernate() result in the
411       system being powered off, rebooted, halted (shut down without turning
412       off power), suspended (the system state is saved to RAM and the CPU is
413       turned off), or hibernated (the system state is saved to disk and the
414       machine is powered down).  HybridSleep() results in the system entering
415       a hybrid-sleep mode, i.e. the system is both hibernated and suspended.
416       SuspendThenHibernate() results in the system being suspended, then
417       later woken using an RTC timer and hibernated. The only argument is the
418       polkit interactivity boolean interactive (see below). The main purpose
419       of these calls is that they enforce polkit policy and hence allow
420       powering off/rebooting/suspending/hibernating even by unprivileged
421       users. They also enforce inhibition locks for non-privileged users. UIs
422       should expose these calls as the primary mechanism to
423       poweroff/reboot/suspend/hibernate the machine. Methods
424       PowerOffWithFlags(), RebootWithFlags(), HaltWithFlags(),
425       SuspendWithFlags(), HibernateWithFlags(), HybridSleepWithFlags() and
426       SuspendThenHibernateWithFlags() add flags to allow for extendability,
427       defined as follows:
428
429           #define SD_LOGIND_ROOT_CHECK_INHIBITORS  (UINT64_C(1) << 0)
430           #define SD_LOGIND_KEXEC_REBOOT           (UINT64_C(1) << 1)
431
432
433       When the flags is 0 then these methods behave just like the versions
434       without flags. When SD_LOGIND_ROOT_CHECK_INHIBITORS (0x01) is set,
435       active inhibitors are honoured for privileged users too. When
436       SD_LOGIND_KEXEC_REBOOT (0x02) is set, then RebootWithFlags() perform
437       kexec reboot if kexec kernel is loaded.
438
439       SetRebootParameter() sets a parameter for a subsequent reboot
440       operation. See the description of reboot in systemctl(1) and reboot(2)
441       for more information.
442
443       SetRebootToFirmwareSetup(), SetRebootToBootLoaderMenu(), and
444       SetRebootToBootLoaderEntry() configure the action to be taken from the
445       boot loader after a reboot: respectively entering firmware setup mode,
446       the boot loader menu, or a specific boot loader entry. See systemctl(1)
447       for the corresponding command line interface.
448
449       CanPowerOff(), CanReboot(), CanHalt(), CanSuspend(), CanHibernate(),
450       CanHybridSleep(), CanSuspendThenHibernate(), CanRebootParameter(),
451       CanRebootToFirmwareSetup(), CanRebootToBootLoaderMenu(), and
452       CanRebootToBootLoaderEntry() test whether the system supports the
453       respective operation and whether the calling user is allowed to execute
454       it. Returns one of "na", "yes", "no", and "challenge". If "na" is
455       returned, the operation is not available because hardware, kernel, or
456       drivers do not support it. If "yes" is returned, the operation is
457       supported and the user may execute the operation without further
458       authentication. If "no" is returned, the operation is available but the
459       user is not allowed to execute the operation. If "challenge" is
460       returned, the operation is available but only after authorization.
461
462       ScheduleShutdown() schedules a shutdown operation type at time usec in
463       microseconds since the UNIX epoch.  type can be one of "poweroff",
464       "dry-poweroff", "reboot", "dry-reboot", "halt", and "dry-halt". (The
465       "dry-" variants do not actually execute the shutdown action.)
466       CancelScheduledShutdown() cancels a scheduled shutdown. The output
467       parameter cancelled is true if a shutdown operation was scheduled.
468
469       SetWallMessage() sets the wall message (the message that will be sent
470       out to all terminals and stored in a utmp(5) record) for a subsequent
471       scheduled shutdown operation. The parameter wall_message specifies the
472       shutdown reason (and may be empty) which will be included in the
473       shutdown message. The parameter enable specifies whether to print a
474       wall message on shutdown.
475
476       Inhibit() creates an inhibition lock. It takes four parameters: what,
477       who, why, and mode.  what is one or more of "shutdown", "sleep",
478       "idle", "handle-power-key", "handle-suspend-key",
479       "handle-hibernate-key", "handle-lid-switch", separated by colons, for
480       inhibiting poweroff/reboot, suspend/hibernate, the automatic idle
481       logic, or hardware key handling.  who should be a short human readable
482       string identifying the application taking the lock.  why should be a
483       short human readable string identifying the reason why the lock is
484       taken. Finally, mode is either "block" or "delay" which encodes whether
485       the inhibit shall be consider mandatory or whether it should just delay
486       the operation to a certain maximum time. The method returns a file
487       descriptor. The lock is released the moment this file descriptor and
488       all its duplicates are closed. For more information on the inhibition
489       logic see Inhibitor Locks[2].
490
491   Signals
492       Whenever the inhibition state or idle hint changes, PropertyChanged
493       signals are sent out to which clients can subscribe.
494
495       The SessionNew, SessionRemoved, UserNew, UserRemoved, SeatNew, and
496       SeatRemoved signals are sent each time a session is created or removed,
497       a user logs in or out, or a seat is added or removed. They each contain
498       the ID of the object plus the object path.
499
500       The PrepareForShutdown() and PrepareForSleep() signals are sent right
501       before (with the argument "true") or after (with the argument "false")
502       the system goes down for reboot/poweroff and suspend/hibernate,
503       respectively. This may be used by applications to save data on disk,
504       release memory, or do other jobs that should be done shortly before
505       shutdown/sleep, in conjunction with delay inhibitor locks. After
506       completion of this work they should release their inhibition locks in
507       order to not delay the operation any further. For more information see
508       Inhibitor Locks[2].
509
510   Properties
511       Most properties simply reflect the configuration, see logind.conf(5).
512       This includes: NAutoVTs, KillOnlyUsers, KillExcludeUsers,
513       KillUserProcesses, IdleAction, InhibitDelayMaxUSec, InhibitorsMax,
514       UserStopDelayUSec, HandlePowerKey, HandleSuspendKey,
515       HandleHibernateKey, HandleLidSwitch, HandleLidSwitchExternalPower,
516       HandleLidSwitchDocked, IdleActionUSec, HoldoffTimeoutUSec, RemoveIPC,
517       RuntimeDirectorySize, RuntimeDirectoryInodesMax, InhibitorsMax, and
518       SessionsMax.
519
520       The IdleHint property reflects the idle hint state of the system. If
521       the system is idle it might get into automatic suspend or shutdown
522       depending on the configuration.
523
524       IdleSinceHint and IdleSinceHintMonotonic encode the timestamps of the
525       last change of the idle hint boolean, in CLOCK_REALTIME and
526       CLOCK_MONOTONIC timestamps, respectively, in microseconds since the
527       epoch.
528
529       The BlockInhibited and DelayInhibited properties encode the currently
530       active locks of the respective modes. They are colon separated lists of
531       "shutdown", "sleep", and "idle" (see above).
532
533       NCurrentSessions and NCurrentInhibitors contain the number of currently
534       registered sessions and inhibitors.
535
536       The BootLoaderEntries property contains a list of boot loader entries.
537       This includes boot loader entries defined in configuration and any
538       additional loader entries reported by the boot loader. See systemd-
539       boot(7) for more information.
540
541       The PreparingForShutdown and PreparingForSleep boolean properties are
542       true during the interval between the two PrepareForShutdown and
543       PrepareForSleep signals respectively. Note that these properties do not
544       send out PropertyChanged signals.
545
546       The RebootParameter property shows the value set with the
547       SetRebootParameter() method described above.
548
549       ScheduledShutdown shows the value pair set with the ScheduleShutdown()
550       method described above.
551
552       RebootToFirmwareSetup, RebootToBootLoaderMenu, and
553       RebootToBootLoaderEntry are true when the resprective post-reboot
554       operation was selected with SetRebootToFirmwareSetup,
555       SetRebootToBootLoaderMenu, or SetRebootToBootLoaderEntry.
556
557       The WallMessage and EnableWallMessages properties reflect the shutdown
558       reason and wall message enablement switch which can be set with the
559       SetWallMessage() method described above.
560
561       Docked is true if the machine is connected to a dock.  LidClosed is
562       true when the lid (of a laptop) is closed.  OnExternalPower is true
563       when the machine is connected to an external power supply.
564
565   Security
566       A number of operations are protected via the polkit privilege system.
567       SetUserLinger() requires the org.freedesktop.login1.set-user-linger
568       privilege.  AttachDevice() requires
569       org.freedesktop.login1.attach-device and FlushDevices() requires
570       org.freedesktop.login1.flush-devices.  PowerOff(), Reboot(), Halt(),
571       Suspend(), Hibernate() require org.freedesktop.login1.power-off,
572       org.freedesktop.login1.power-off-multiple-sessions,
573       org.freedesktop.login1.power-off-ignore-inhibit,
574       org.freedesktop.login1.reboot,
575       org.freedesktop.login1.reboot-multiple-sessions,
576       org.freedesktop.login1.reboot-ignore-inhibit,
577       org.freedesktop.login1.halt,
578       org.freedesktop.login1.halt-multiple-sessions,
579       org.freedesktop.login1.halt-ignore-inhibit,
580       org.freedesktop.login1.suspend,
581       org.freedesktop.login1.suspend-multiple-sessions,
582       org.freedesktop.login1.suspend-ignore-inhibit,
583       org.freedesktop.login1.hibernate,
584       org.freedesktop.login1.hibernate-multiple-sessions,
585       org.freedesktop.login1.hibernate-ignore-inhibit, respectively depending
586       on whether there are other sessions around or active inhibits are
587       present.  HybridSleep() and SuspendThenHibernate() use the same
588       privileges as Hibernate().  SetRebootParameter() requires
589       org.freedesktop.login1.set-reboot-parameter.
590
591       SetRebootToFirmwareSetup requires
592       org.freedesktop.login1.set-reboot-to-firmware-setup.
593       SetRebootToBootLoaderMenu requires
594       org.freedesktop.login1.set-reboot-to-boot-loader-menu.
595       SetRebootToBootLoaderEntry requires
596       org.freedesktop.login1.set-reboot-to-boot-loader-entry.
597
598       ScheduleShutdown and CancelScheduledShutdown require the same
599       privileges (listed above) as the immediate poweroff/reboot/halt
600       operations.
601
602       Inhibit() is protected via one of
603       org.freedesktop.login1.inhibit-block-shutdown,
604       org.freedesktop.login1.inhibit-delay-shutdown,
605       org.freedesktop.login1.inhibit-block-sleep,
606       org.freedesktop.login1.inhibit-delay-sleep,
607       org.freedesktop.login1.inhibit-block-idle,
608       org.freedesktop.login1.inhibit-handle-power-key,
609       org.freedesktop.login1.inhibit-handle-suspend-key,
610       org.freedesktop.login1.inhibit-handle-hibernate-key,
611       org.freedesktop.login1.inhibit-handle-lid-switch depending on the lock
612       type and mode taken.
613
614       The interactive boolean parameters can be used to control whether
615       polkit should interactively ask the user for authentication credentials
616       if required.
617

SEAT OBJECTS

619           node /org/freedesktop/login1/seat/seat0 {
620             interface org.freedesktop.login1.Seat {
621               methods:
622                 Terminate();
623                 ActivateSession(in  s session_id);
624                 SwitchTo(in  u vtnr);
625                 SwitchToNext();
626                 SwitchToPrevious();
627               properties:
628                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
629                 readonly s Id = '...';
630                 readonly (so) ActiveSession = ...;
631                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
632                 readonly b CanTTY = ...;
633                 readonly b CanGraphical = ...;
634                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
635                 readonly a(so) Sessions = [...];
636                 readonly b IdleHint = ...;
637                 readonly t IdleSinceHint = ...;
638                 readonly t IdleSinceHintMonotonic = ...;
639             };
640             interface org.freedesktop.DBus.Peer { ... };
641             interface org.freedesktop.DBus.Introspectable { ... };
642             interface org.freedesktop.DBus.Properties { ... };
643           };
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660   Methods
661       Terminate() and ActivateSession() work similar to TerminateSeat(),
662       ActivationSessionOnSeat() on the Manager object.
663
664       SwitchTo() switches to the session on the virtual terminal vtnr.
665       SwitchToNext() and SwitchToPrevious() switch to, respectively, the next
666       and previous sessions on the seat in the order of virtual terminals. If
667       there is no active session, they switch to, respectively, the first and
668       last session on the seat.
669
670   Signals
671       Whenever ActiveSession, Sessions, CanGraphical, CanTTY, or the idle
672       state changes, PropertyChanged signals are sent out to which clients
673       can subscribe.
674
675   Properties
676       The Id property encodes the ID of the seat.
677
678       ActiveSession encodes the currently active session if there is one. It
679       is a structure consisting of the session id and the object path.
680
681       CanTTY encodes whether the session is suitable for text logins, and
682       CanGraphical whether it is suitable for graphical sessions.
683
684       The Sessions property is an array of all current sessions of this seat,
685       each encoded in a structure consisting of the ID and the object path.
686
687       The IdleHint, IdleSinceHint, and IdleSinceHintMonotonic properties
688       encode the idle state, similar to the ones exposed on the Manager
689       object, but specific for this seat.
690

USER OBJECTS

692           node /org/freedesktop/login1/user/_1000 {
693             interface org.freedesktop.login1.User {
694               methods:
695                 Terminate();
696                 Kill(in  i signal_number);
697               properties:
698                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
699                 readonly u UID = ...;
700                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
701                 readonly u GID = ...;
702                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
703                 readonly s Name = '...';
704                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
705                 readonly t Timestamp = ...;
706                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
707                 readonly t TimestampMonotonic = ...;
708                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
709                 readonly s RuntimePath = '...';
710                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
711                 readonly s Service = '...';
712                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
713                 readonly s Slice = '...';
714                 readonly (so) Display = ...;
715                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
716                 readonly s State = '...';
717                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
718                 readonly a(so) Sessions = [...];
719                 readonly b IdleHint = ...;
720                 readonly t IdleSinceHint = ...;
721                 readonly t IdleSinceHintMonotonic = ...;
722                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
723                 readonly b Linger = ...;
724             };
725             interface org.freedesktop.DBus.Peer { ... };
726             interface org.freedesktop.DBus.Introspectable { ... };
727             interface org.freedesktop.DBus.Properties { ... };
728           };
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749   Methods
750       Terminate() and Kill() work similar to the TerminateUser() and
751       KillUser() methods on the manager object.
752
753   Signals
754       Whenever Sessions or the idle state changes, PropertyChanged signals
755       are sent out to which clients can subscribe.
756
757   Properties
758       The UID and GID properties encode the Unix UID and primary GID of the
759       user.
760
761       The Name property encodes the user name.
762
763       Timestamp and TimestampMonotonic encode the login time of the user in
764       microseconds since the epoch, in the CLOCK_REALTIME and CLOCK_MONOTONIC
765       clocks, respectively.
766
767       RuntimePath encodes the runtime path of the user, i.e.
768       $XDG_RUNTIME_DIR. For details see the XDG Basedir Specification[3].
769
770       Service contains the unit name of the user systemd service of this
771       user. Each logged in user is assigned a user service that runs a user
772       systemd instance. This is usually an instance of user@.service.
773
774       Slice contains the unit name of the user systemd slice of this user.
775       Each logged in user gets a private slice.
776
777       Display encodes which graphical session should be used as the primary
778       UI display for the user. It is a structure encoding the session ID and
779       the object path of the session to use.
780
781       State encodes the user state and is one of "offline", "lingering",
782       "online", "active", or "closing". See sd_uid_get_state(3) for more
783       information about the states.
784
785       Sessions is an array of structures encoding all current sessions of the
786       user. Each structure consists of the ID and object path.
787
788       The IdleHint, IdleSinceHint, and IdleSinceHintMonotonic properties
789       encode the idle hint state of the user, similar to the Manager's
790       properties, but specific for this user.
791
792       The Linger property shows whether lingering is enabled for this user.
793

SESSION OBJECTS

795           node /org/freedesktop/login1/session/1 {
796             interface org.freedesktop.login1.Session {
797               methods:
798                 Terminate();
799                 Activate();
800                 Lock();
801                 Unlock();
802                 SetIdleHint(in  b idle);
803                 SetLockedHint(in  b locked);
804                 Kill(in  s who,
805                      in  i signal_number);
806                 TakeControl(in  b force);
807                 ReleaseControl();
808                 SetType(in  s type);
809                 TakeDevice(in  u major,
810                            in  u minor,
811                            out h fd,
812                            out b inactive);
813                 ReleaseDevice(in  u major,
814                               in  u minor);
815                 PauseDeviceComplete(in  u major,
816                                     in  u minor);
817                 SetBrightness(in  s subsystem,
818                               in  s name,
819                               in  u brightness);
820               signals:
821                 PauseDevice(u major,
822                             u minor,
823                             s type);
824                 ResumeDevice(u major,
825                              u minor,
826                              h fd);
827                 Lock();
828                 Unlock();
829               properties:
830                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
831                 readonly s Id = '...';
832                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
833                 readonly (uo) User = ...;
834                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
835                 readonly s Name = '...';
836                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
837                 readonly t Timestamp = ...;
838                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
839                 readonly t TimestampMonotonic = ...;
840                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
841                 readonly u VTNr = ...;
842                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
843                 readonly (so) Seat = ...;
844                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
845                 readonly s TTY = '...';
846                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
847                 readonly s Display = '...';
848                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
849                 readonly b Remote = ...;
850                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
851                 readonly s RemoteHost = '...';
852                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
853                 readonly s RemoteUser = '...';
854                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
855                 readonly s Service = '...';
856                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
857                 readonly s Desktop = '...';
858                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
859                 readonly s Scope = '...';
860                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
861                 readonly u Leader = ...;
862                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
863                 readonly u Audit = ...;
864                 readonly s Type = '...';
865                 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
866                 readonly s Class = '...';
867                 readonly b Active = ...;
868                 readonly s State = '...';
869                 readonly b IdleHint = ...;
870                 readonly t IdleSinceHint = ...;
871                 readonly t IdleSinceHintMonotonic = ...;
872                 readonly b LockedHint = ...;
873             };
874             interface org.freedesktop.DBus.Peer { ... };
875             interface org.freedesktop.DBus.Introspectable { ... };
876             interface org.freedesktop.DBus.Properties { ... };
877           };
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924   Methods
925       Terminate(), Activate(), Lock(), Unlock(), and Kill() work similarly to
926       the respective calls on the Manager object.
927
928       SetIdleHint() is called by the session object to update the idle state
929       of the session whenever it changes.
930
931       TakeControl() allows a process to take exclusive managed device
932       access-control for that session. Only one D-Bus connection can be a
933       controller for a given session at any time. If the force argument is
934       set (root only), an existing controller is kicked out and replaced.
935       Otherwise, this method fails if there is already a controller. Note
936       that this method is limited to D-Bus users with the effective UID set
937       to the user of the session or root.
938
939       ReleaseControl() drops control of a given session. Closing the D-Bus
940       connection implicitly releases control as well. See TakeControl() for
941       more information. This method also releases all devices for which the
942       controller requested ownership via TakeDevice().
943
944       SetType() allows the type of the session to be changed dynamically. It
945       can only be called by session's current controller. If TakeControl()
946       has not been called, this method will fail. In addition, the session
947       type will be reset to its original value once control is released,
948       either by calling ReleaseControl() or closing the D-Bus connection.
949       This should help prevent a session from entering an inconsistent state,
950       for example if the controller crashes. The only argument type is the
951       new session type.
952
953       TakeDevice() allows a session controller to get a file descriptor for a
954       specific device. Pass in the major and minor numbers of the character
955       device and systemd-logind will return a file descriptor for the device.
956       Only a limited set of device-types is currently supported (but may be
957       extended).  systemd-logind automatically mutes the file descriptor if
958       the session is inactive and resumes it once the session is activated
959       again. This guarantees that a session can only access session devices
960       if the session is active. Note that this revoke/resume mechanism is
961       asynchronous and may happen at any given time. This only works on
962       devices that are attached to the seat of the given session. A process
963       is not required to have direct access to the device node.
964       systemd-logind only requires you to be the active session controller
965       (see TakeControl()). Also note that any device can only be requested
966       once. As long as you don't release it, further TakeDevice() calls will
967       fail.
968
969       ReleaseDevice() releases a device again (see TakeDevice()). This is
970       also implicitly done by ReleaseControl() or when closing the D-Bus
971       connection.
972
973       PauseDeviceComplete() allows a session controller to synchronously
974       pause a device after receiving a PauseDevice("pause") signal. Forced
975       signals (or after an internal timeout) are automatically completed by
976       systemd-logind asynchronously.
977
978       SetLockedHint() may be used to set the "locked hint" to locked, i.e.
979       information whether the session is locked. This is intended to be used
980       by the desktop environment to tell systemd-logind when the session is
981       locked and unlocked.
982
983       SetBrightness() may be used to set the display brightness. This is
984       intended to be used by the desktop environment and allows unprivileged
985       programs to access hardware settings in a controlled way. The subsystem
986       parameter specifies a kernel subsystem, either "backlight" or "leds".
987       The name parameter specifies a device name under the specified
988       subsystem. The brightness parameter specifies the brightness. The range
989       is defined by individual drivers, see
990       /sys/class/subsystem/name/max_brightness.
991
992   Signals
993       The active session controller exclusively gets PauseDevice and
994       ResumeDevice events for any device it requested via TakeDevice(). They
995       notify the controller whenever a device is paused or resumed. A device
996       is never resumed if its session is inactive. Also note that PauseDevice
997       signals are sent before the PropertyChanged signal for the Active
998       state. The inverse is true for ResumeDevice. A device may remain paused
999       for unknown reasons even though the Session is active.
1000
1001       A PauseDevice signal carries the major and minor numbers and a string
1002       describing the type as arguments.  force means the device was already
1003       paused by systemd-logind and the signal is only an asynchronous
1004       notification.  pause means systemd-logind grants you a limited amount
1005       of time to pause the device. You must respond to this via
1006       PauseDeviceComplete(). This synchronous pausing mechanism is used for
1007       backwards-compatibility to VTs and systemd-logind is free to not make
1008       use of it. It is also free to send a forced PauseDevice if you don't
1009       respond in a timely manner (or for any other reason).  gone means the
1010       device was unplugged from the system and you will no longer get any
1011       notifications about it. There is no need to call ReleaseDevice(). You
1012       may call TakeDevice() again if a new device is assigned the major+minor
1013       combination.
1014
1015       ResumeDevice is sent whenever a session is active and a device is
1016       resumed. It carries the major/minor numbers as arguments and provides a
1017       new open file descriptor. You should switch to the new descriptor and
1018       close the old one. They are not guaranteed to have the same underlying
1019       open file descriptor in the kernel (except for a limited set of device
1020       types).
1021
1022       Whenever Active or the idle state changes, PropertyChanged signals are
1023       sent out to which clients can subscribe.
1024
1025       Lock/Unlock is sent when the session is asked to be
1026       screen-locked/unlocked. A session manager of the session should listen
1027       to this signal and act accordingly. This signal is sent out as a result
1028       of the Lock() and Unlock() methods, respectively.
1029
1030   Properties
1031       Id encodes the session ID.
1032
1033       User encodes the user ID of the user this session belongs to. This is a
1034       structure consisting of the Unix UID and the object path.
1035
1036       Name encodes the user name.
1037
1038       Timestamp and TimestampMonotonic encode the microseconds since the
1039       epoch when the session was created, in CLOCK_REALTIME or
1040       CLOCK_MONOTONIC, respectively.
1041
1042       VTNr encodes the virtual terminal number of the session if there is
1043       any, 0 otherwise.
1044
1045       Seat encodes the seat this session belongs to if there is any. This is
1046       a structure consisting of the ID and the seat object path.
1047
1048       TTY encodes the kernel TTY path of the session if this is a text login.
1049       If not this is an empty string.
1050
1051       Display encodes the X11 display name if this is a graphical login. If
1052       not, this is an empty string.
1053
1054       Remote encodes whether the session is local or remote.
1055
1056       RemoteHost and RemoteUser encode the remote host and user if this is a
1057       remote session, or an empty string otherwise.
1058
1059       Service encodes the PAM service name that registered the session.
1060
1061       Desktop describes the desktop environment running in the session (if
1062       known).
1063
1064       Scope contains the systemd scope unit name of this session.
1065
1066       Leader encodes the PID of the process that registered the session.
1067
1068       Audit encodes the Kernel Audit session ID of the session if auditing is
1069       available.
1070
1071       Type encodes the session type. It's one of "unspecified" (for cron PAM
1072       sessions and suchlike), "tty" (for text logins) or
1073       "x11"/"mir"/"wayland" (for graphical logins).
1074
1075       Class encodes the session class. It's one of "user" (for normal user
1076       sessions), "greeter" (for display manager pseudo-sessions), or
1077       "lock-screen" (for display lock screens).
1078
1079       Active is a boolean that is true if the session is active, i.e.
1080       currently in the foreground. This field is semi-redundant due to State.
1081
1082       State encodes the session state and one of "online", "active", or
1083       "closing". See sd_session_get_state(3) for more information about the
1084       states.
1085
1086       IdleHint, IdleSinceHint, and IdleSinceHintMonotonic encapsulate the
1087       idle hint state of this session, similarly to how the respective
1088       properties on the manager object do it for the whole system.
1089
1090       LockedHint shows the locked hint state of this session, as set by the
1091       SetLockedHint() method described above.
1092

EXAMPLES

1094       Example 1. Introspect org.freedesktop.login1.Manager on the bus
1095
1096           $ gdbus introspect --system --dest org.freedesktop.login1 \
1097             --object-path /org/freedesktop/login1
1098
1099
1100       Example 2. Introspect org.freedesktop.login1.Seat on the bus
1101
1102           $ gdbus introspect --system --dest org.freedesktop.login1 \
1103            --object-path /org/freedesktop/login1/seat/seat0
1104
1105
1106       Example 3. Introspect org.freedesktop.login1.User on the bus
1107
1108           $ gdbus introspect --system --dest org.freedesktop.login1 \
1109             --object-path /org/freedesktop/login1/user/_1000
1110
1111
1112       Example 4. Introspect org.freedesktop.login1.Session on the bus
1113
1114           $ gdbus introspect --system --dest org.freedesktop.login1 \
1115             --object-path /org/freedesktop/login1/session/45
1116
1117

VERSIONING

1119       These D-Bus interfaces follow the usual interface versioning
1120       guidelines[4].
1121

NOTES

1123        1. polkit
1124           https://www.freedesktop.org/software/polkit/docs/latest/
1125
1126        2. Inhibitor Locks
1127           https://www.freedesktop.org/wiki/Software/systemd/inhibit
1128
1129        3. XDG Basedir Specification
1130           https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
1131
1132        4. the usual interface versioning guidelines
1133           http://0pointer.de/blog/projects/versioning-dbus.html
1134
1135
1136
1137systemd 250                                          ORG.FREEDESKTOP.LOGIN1(5)
Impressum