1ORG.FREEDESKTOP.LOGIN1(5) org.freedesktop.login1 ORG.FREEDESKTOP.LOGIN1(5)
2
3
4
6 org.freedesktop.login1 - The D-Bus interface of systemd-logind
7
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
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 CreateSession(in u uid,
40 in u pid,
41 in s service,
42 in s type,
43 in s class,
44 in s desktop,
45 in s seat_id,
46 in u vtnr,
47 in s tty,
48 in s display,
49 in b remote,
50 in s remote_user,
51 in s remote_host,
52 in a(sv) properties,
53 out s session_id,
54 out o object_path,
55 out s runtime_path,
56 out h fifo_fd,
57 out u uid,
58 out s seat_id,
59 out u vtnr,
60 out b existing);
61 ReleaseSession(in s session_id);
62 ActivateSession(in s session_id);
63 ActivateSessionOnSeat(in s session_id,
64 in s seat_id);
65 LockSession(in s session_id);
66 UnlockSession(in s session_id);
67 LockSessions();
68 UnlockSessions();
69 KillSession(in s session_id,
70 in s who,
71 in i signal_number);
72 KillUser(in u uid,
73 in i signal_number);
74 TerminateSession(in s session_id);
75 TerminateUser(in u uid);
76 TerminateSeat(in s seat_id);
77 SetUserLinger(in u uid,
78 in b enable,
79 in b interactive);
80 AttachDevice(in s seat_id,
81 in s sysfs_path,
82 in b interactive);
83 FlushDevices(in b interactive);
84 PowerOff(in b interactive);
85 Reboot(in b interactive);
86 Halt(in b interactive);
87 Suspend(in b interactive);
88 Hibernate(in b interactive);
89 HybridSleep(in b interactive);
90 SuspendThenHibernate(in b interactive);
91 CanPowerOff(out s result);
92 CanReboot(out s result);
93 CanHalt(out s result);
94 CanSuspend(out s result);
95 CanHibernate(out s result);
96 CanHybridSleep(out s result);
97 CanSuspendThenHibernate(out s result);
98 ScheduleShutdown(in s type,
99 in t usec);
100 CancelScheduledShutdown(out b cancelled);
101 Inhibit(in s what,
102 in s who,
103 in s why,
104 in s mode,
105 out h pipe_fd);
106 CanRebootParameter(out s result);
107 SetRebootParameter(in s parameter);
108 CanRebootToFirmwareSetup(out s result);
109 SetRebootToFirmwareSetup(in b enable);
110 CanRebootToBootLoaderMenu(out s result);
111 SetRebootToBootLoaderMenu(in t timeout);
112 CanRebootToBootLoaderEntry(out s result);
113 SetRebootToBootLoaderEntry(in s boot_loader_entry);
114 SetWallMessage(in s wall_message,
115 in b enable);
116 signals:
117 SessionNew(s session_id,
118 o object_path);
119 SessionRemoved(s session_id,
120 o object_path);
121 UserNew(u uid,
122 o object_path);
123 UserRemoved(u uid,
124 o object_path);
125 SeatNew(s seat_id,
126 o object_path);
127 SeatRemoved(s seat_id,
128 o object_path);
129 PrepareForShutdown(b start);
130 PrepareForSleep(b start);
131 properties:
132 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
133 @org.freedesktop.systemd1.Privileged("true")
134 readwrite b EnableWallMessages = ...;
135 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
136 @org.freedesktop.systemd1.Privileged("true")
137 readwrite s WallMessage = '...';
138 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
139 readonly u NAutoVTs = ...;
140 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
141 readonly as KillOnlyUsers = ['...', ...];
142 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
143 readonly as KillExcludeUsers = ['...', ...];
144 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
145 readonly b KillUserProcesses = ...;
146 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
147 readonly s RebootParameter = '...';
148 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
149 readonly b RebootToFirmwareSetup = ...;
150 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
151 readonly t RebootToBootLoaderMenu = ...;
152 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
153 readonly s RebootToBootLoaderEntry = '...';
154 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
155 readonly as BootLoaderEntries = ['...', ...];
156 readonly b IdleHint = ...;
157 readonly t IdleSinceHint = ...;
158 readonly t IdleSinceHintMonotonic = ...;
159 readonly s BlockInhibited = '...';
160 readonly s DelayInhibited = '...';
161 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
162 readonly t InhibitDelayMaxUSec = ...;
163 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
164 readonly t UserStopDelayUSec = ...;
165 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
166 readonly s HandlePowerKey = '...';
167 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
168 readonly s HandleSuspendKey = '...';
169 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
170 readonly s HandleHibernateKey = '...';
171 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
172 readonly s HandleLidSwitch = '...';
173 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
174 readonly s HandleLidSwitchExternalPower = '...';
175 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
176 readonly s HandleLidSwitchDocked = '...';
177 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
178 readonly t HoldoffTimeoutUSec = ...;
179 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
180 readonly s IdleAction = '...';
181 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
182 readonly t IdleActionUSec = ...;
183 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
184 readonly b PreparingForShutdown = ...;
185 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
186 readonly b PreparingForSleep = ...;
187 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
188 readonly (st) ScheduledShutdown = ...;
189 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
190 readonly b Docked = ...;
191 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
192 readonly b LidClosed = ...;
193 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
194 readonly b OnExternalPower = ...;
195 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
196 readonly b RemoveIPC = ...;
197 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
198 readonly t RuntimeDirectorySize = ...;
199 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
200 readonly t RuntimeDirectoryInodesMax = ...;
201 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
202 readonly t InhibitorsMax = ...;
203 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
204 readonly t NCurrentInhibitors = ...;
205 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
206 readonly t SessionsMax = ...;
207 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
208 readonly t NCurrentSessions = ...;
209 };
210 interface org.freedesktop.DBus.Peer { ... };
211 interface org.freedesktop.DBus.Introspectable { ... };
212 interface org.freedesktop.DBus.Properties { ... };
213 };
214
215
216
217
218
219
220
221
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 Methods
317 GetSession() may be used to get the session object path for the session
318 with the specified ID. Similarly, GetUser() and GetSeat() get the user
319 and seat objects, respectively. GetSessionByPID() and GetUserByPID()
320 get the session/user object the specified PID belongs to if there is
321 any.
322
323 ListSessions() returns an array of all current sessions. The structures
324 in the array consist of the following fields: session id, user id, user
325 name, seat id, session object path. If a session does not have a seat
326 attached, the seat id field will be an empty string.
327
328 ListUsers() returns an array of all currently logged in users. The
329 structures in the array consist of the following fields: user id, user
330 name, user object path.
331
332 ListSeats() returns an array of all currently available seats. The
333 structure in the array consists of the following fields: seat id, seat
334 object path.
335
336 ListInhibitors() lists all currently active inhibitors. It returns an
337 array of structures consisting of what, who, why, mode, uid (user ID),
338 and pid (process ID).
339
340 CreateSession() and ReleaseSession() may be used to open or close login
341 sessions. These calls should never be invoked directly by clients.
342 Creating/closing sessions is exclusively the job of PAM and its
343 pam_systemd(8) module.
344
345 ActivateSession() brings the session with the specified ID into the
346 foreground. ActivateSessionOnSeat() does the same, but only if the
347 seat id matches.
348
349 LockSession() asks the session with the specified ID to activate the
350 screen lock. UnlockSession() asks the session with the specified ID to
351 remove an active screen lock, if there is any. This is implemented by
352 sending out the Lock() and Unlock() signals from the respective session
353 object which session managers are supposed to listen on.
354
355 LockSessions() asks all sessions to activate their screen locks. This
356 may be used to lock access to the entire machine in one action.
357 Similarly, UnlockSessions() asks all sessions to deactivate their
358 screen locks.
359
360 KillSession() may be used to send a Unix signal to one or all processes
361 of a session. As arguments it takes the session id, either the string
362 "leader" or "all" and a signal number. If "leader" is passed only the
363 session "leader" is killed. If "all" is passed all processes of the
364 session are killed.
365
366 KillUser() may be used to send a Unix signal to all processes of a
367 user. As arguments it takes the user id and a signal number.
368
369 TerminateSession(), TerminateUser(), TerminateSeat() may be used to
370 forcibly terminate one specific session, all processes of a user, and
371 all sessions attached to a specific seat, respectively. The session,
372 user, and seat are identified by their respective IDs.
373
374 SetUserLinger() enables or disables user lingering. If enabled, the
375 runtime directory of a user is kept around and they may continue to run
376 processes while logged out. If disabled, the runtime directory goes
377 away as soon as they log out. SetUserLinger() expects three arguments:
378 the UID, a boolean whether to enable/disable and a boolean controlling
379 the polkit[1] authorization interactivity (see below). Note that the
380 user linger state is persistently stored on disk.
381
382 AttachDevice() may be used to assign a specific device to a specific
383 seat. The device is identified by its /sys path and must be eligible
384 for seat assignments. AttachDevice() takes three arguments: the seat
385 id, the sysfs path, and a boolean for controlling polkit interactivity
386 (see below). Device assignments are persistently stored on disk. To
387 create a new seat, simply specify a previously unused seat id. For more
388 information about the seat assignment logic see Multi-Seat for
389 Linux[2].
390
391 FlushDevices() removes all explicit seat assignments for devices,
392 resetting all assignments to the automatic defaults. The only argument
393 it takes is the polkit interactivity boolean (see below).
394
395 PowerOff(), Reboot(), Halt(), Suspend(), and Hibernate() result in the
396 system being powered off, rebooted, halted (shut down without turning
397 off power), suspended (the system state is saved to RAM and the CPU is
398 turned off), or hibernated (the system state is saved to disk and the
399 machine is powered down). HybridSleep() results in the system entering
400 a hybrid-sleep mode, i.e. the system is both hibernated and suspended.
401 SuspendThenHibernate() results in the system being suspended, then
402 later woken using an RTC timer and hibernated. The only argument is the
403 polkit interactivity boolean interactive (see below). The main purpose
404 of these calls is that they enforce polkit policy and hence allow
405 powering off/rebooting/suspending/hibernating even by unprivileged
406 users. They also enforce inhibition locks. UIs should expose these
407 calls as the primary mechanism to poweroff/reboot/suspend/hibernate the
408 machine.
409
410 SetRebootParameter() sets a parameter for a subsequent reboot
411 operation. See the description of reboot in systemctl(1) and reboot(2)
412 for more information.
413
414 SetRebootToFirmwareSetup(), SetRebootToBootLoaderMenu(), and
415 SetRebootToBootLoaderEntry() configure the action to be taken from the
416 boot loader after a reboot: respectively entering firmware setup mode,
417 the boot loader menu, or a specific boot loader entry. See systemctl(1)
418 for the corresponding command line interface.
419
420 CanPowerOff(), CanReboot(), CanHalt(), CanSuspend(), CanHibernate(),
421 CanHybridSleep(), CanSuspendThenHibernate(), CanRebootParameter(),
422 CanRebootToFirmwareSetup(), CanRebootToBootLoaderMenu(), and
423 CanRebootToBootLoaderEntry() test whether the system supports the
424 respective operation and whether the calling user is allowed to execute
425 it. Returns one of "na", "yes", "no", and "challenge". If "na" is
426 returned, the operation is not available because hardware, kernel, or
427 drivers do not support it. If "yes" is returned, the operation is
428 supported and the user may execute the operation without further
429 authentication. If "no" is returned, the operation is available but the
430 user is not allowed to execute the operation. If "challenge" is
431 returned, the operation is available but only after authorization.
432
433 ScheduleShutdown() schedules a shutdown operation type at time usec in
434 microseconds since the UNIX epoch. type can be one of "poweroff",
435 "dry-poweroff", "reboot", "dry-reboot", "halt", and "dry-halt". (The
436 "dry-" variants do not actually execute the shutdown action.)
437 CancelScheduledShutdown() cancels a scheduled shutdown. The output
438 parameter cancelled is true if a shutdown operation was scheduled.
439
440 SetWallMessage() sets the wall message (the message that will be sent
441 out to all terminals and stored in a utmp(5) record) for a subsequent
442 scheduled shutdown operation. The parameter wall_message specifies the
443 shutdown reason (and may be empty) which will be included in the
444 shutdown message. The parameter enable specifies whether to print a
445 wall message on shutdown.
446
447 Inhibit() creates an inhibition lock. It takes four parameters: what,
448 who, why, and mode. what is one or more of "shutdown", "sleep",
449 "idle", "handle-power-key", "handle-suspend-key",
450 "handle-hibernate-key", "handle-lid-switch", separated by colons, for
451 inhibiting poweroff/reboot, suspend/hibernate, the automatic idle
452 logic, or hardware key handling. who should be a short human readable
453 string identifying the application taking the lock. why should be a
454 short human readable string identifying the reason why the lock is
455 taken. Finally, mode is either "block" or "delay" which encodes whether
456 the inhibit shall be consider mandatory or whether it should just delay
457 the operation to a certain maximum time. The method returns a file
458 descriptor. The lock is released the moment this file descriptor and
459 all its duplicates are closed. For more information on the inhibition
460 logic see Inhibitor Locks[3].
461
462 Signals
463 Whenever the inhibition state or idle hint changes, PropertyChanged
464 signals are sent out to which clients can subscribe.
465
466 The SessionNew, SessionRemoved, UserNew, UserRemoved, SeatNew, and
467 SeatRemoved signals are sent each time a session is created or removed,
468 a user logs in or out, or a seat is added or removed. They each contain
469 the ID of the object plus the object path.
470
471 The PrepareForShutdown() and PrepareForSleep() signals are sent right
472 before (with the argument "true") or after (with the argument "false")
473 the system goes down for reboot/poweroff and suspend/hibernate,
474 respectively. This may be used by applications to save data on disk,
475 release memory, or do other jobs that should be done shortly before
476 shutdown/sleep, in conjunction with delay inhibitor locks. After
477 completion of this work they should release their inhibition locks in
478 order to not delay the operation any further. For more information see
479 Inhibitor Locks[3].
480
481 Properties
482 Most properties simply reflect the configuration, see logind.conf(5).
483 This includes: NAutoVTs, KillOnlyUsers, KillExcludeUsers,
484 KillUserProcesses, IdleAction, InhibitDelayMaxUSec, InhibitorsMax,
485 UserStopDelayUSec, HandlePowerKey, HandleSuspendKey,
486 HandleHibernateKey, HandleLidSwitch, HandleLidSwitchExternalPower,
487 HandleLidSwitchDocked, IdleActionUSec, HoldoffTimeoutUSec, RemoveIPC,
488 RuntimeDirectorySize, RuntimeDirectoryInodesMax, InhibitorsMax, and
489 SessionsMax.
490
491 The IdleHint property reflects the idle hint state of the system. If
492 the system is idle it might get into automatic suspend or shutdown
493 depending on the configuration.
494
495 IdleSinceHint and IdleSinceHintMonotonic encode the timestamps of the
496 last change of the idle hint boolean, in CLOCK_REALTIME and
497 CLOCK_MONOTONIC timestamps, respectively, in microseconds since the
498 epoch.
499
500 The BlockInhibited and DelayInhibited properties encode the currently
501 active locks of the respective modes. They are colon separated lists of
502 "shutdown", "sleep", and "idle" (see above).
503
504 NCurrentSessions and NCurrentInhibitors contain the number of currently
505 registered sessions and inhibitors.
506
507 The BootLoaderEntries property contains a list of boot loader entries.
508 This includes boot loader entries defined in configuration and any
509 additional loader entries reported by the boot loader. See systemd-
510 boot(7) for more information.
511
512 The PreparingForShutdown and PreparingForSleep boolean properties are
513 true during the interval between the two PrepareForShutdown and
514 PrepareForSleep signals respectively. Note that these properties do not
515 send out PropertyChanged signals.
516
517 The RebootParameter property shows the value set with the
518 SetRebootParameter() method described above.
519
520 ScheduledShutdown shows the value pair set with the ScheduleShutdown()
521 method described above.
522
523 RebootToFirmwareSetup, RebootToBootLoaderMenu, and
524 RebootToBootLoaderEntry are true when the resprective post-reboot
525 operation was selected with SetRebootToFirmwareSetup,
526 SetRebootToBootLoaderMenu, or SetRebootToBootLoaderEntry.
527
528 The WallMessage and EnableWallMessages properties reflect the shutdown
529 reason and wall message enablement switch which can be set with the
530 SetWallMessage() method described above.
531
532 Docked is true if the machine is connected to a dock. LidClosed is
533 true when the lid (of a laptop) is closed. OnExternalPower is true
534 when the machine is connected to an external power supply.
535
536 Security
537 A number of operations are protected via the polkit privilege system.
538 SetUserLinger() requires the org.freedesktop.login1.set-user-linger
539 privilege. AttachDevice() requires
540 org.freedesktop.login1.attach-device and FlushDevices() requires
541 org.freedesktop.login1.flush-devices. PowerOff(), Reboot(), Halt(),
542 Suspend(), Hibernate() require org.freedesktop.login1.power-off,
543 org.freedesktop.login1.power-off-multiple-sessions,
544 org.freedesktop.login1.power-off-ignore-inhibit,
545 org.freedesktop.login1.reboot,
546 org.freedesktop.login1.reboot-multiple-sessions,
547 org.freedesktop.login1.reboot-ignore-inhibit,
548 org.freedesktop.login1.halt,
549 org.freedesktop.login1.halt-multiple-sessions,
550 org.freedesktop.login1.halt-ignore-inhibit,
551 org.freedesktop.login1.suspend,
552 org.freedesktop.login1.suspend-multiple-sessions,
553 org.freedesktop.login1.suspend-ignore-inhibit,
554 org.freedesktop.login1.hibernate,
555 org.freedesktop.login1.hibernate-multiple-sessions,
556 org.freedesktop.login1.hibernate-ignore-inhibit, respectively depending
557 on whether there are other sessions around or active inhibits are
558 present. HybridSleep() and SuspendThenHibernate() use the same
559 privileges as Hibernate(). SetRebootParameter() requires
560 org.freedesktop.login1.set-reboot-parameter.
561
562 SetRebootToFirmwareSetup requires
563 org.freedesktop.login1.set-reboot-to-firmware-setup.
564 SetRebootToBootLoaderMenu requires
565 org.freedesktop.login1.set-reboot-to-boot-loader-menu.
566 SetRebootToBootLoaderEntry requires
567 org.freedesktop.login1.set-reboot-to-boot-loader-entry.
568
569 ScheduleShutdown and CancelScheduledShutdown require the same
570 privileges (listed above) as the immediate poweroff/reboot/halt
571 operations.
572
573 Inhibit() is protected via one of
574 org.freedesktop.login1.inhibit-block-shutdown,
575 org.freedesktop.login1.inhibit-delay-shutdown,
576 org.freedesktop.login1.inhibit-block-sleep,
577 org.freedesktop.login1.inhibit-delay-sleep,
578 org.freedesktop.login1.inhibit-block-idle,
579 org.freedesktop.login1.inhibit-handle-power-key,
580 org.freedesktop.login1.inhibit-handle-suspend-key,
581 org.freedesktop.login1.inhibit-handle-hibernate-key,
582 org.freedesktop.login1.inhibit-handle-lid-switch depending on the lock
583 type and mode taken.
584
585 The interactive boolean parameters can be used to control whether
586 polkit should interactively ask the user for authentication credentials
587 if required.
588
590 node /org/freedesktop/login1/seat/seat0 {
591 interface org.freedesktop.login1.Seat {
592 methods:
593 Terminate();
594 ActivateSession(in s session_id);
595 SwitchTo(in u vtnr);
596 SwitchToNext();
597 SwitchToPrevious();
598 properties:
599 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
600 readonly s Id = '...';
601 readonly (so) ActiveSession = ...;
602 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
603 readonly b CanTTY = ...;
604 readonly b CanGraphical = ...;
605 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
606 readonly a(so) Sessions = [...];
607 readonly b IdleHint = ...;
608 readonly t IdleSinceHint = ...;
609 readonly t IdleSinceHintMonotonic = ...;
610 };
611 interface org.freedesktop.DBus.Peer { ... };
612 interface org.freedesktop.DBus.Introspectable { ... };
613 interface org.freedesktop.DBus.Properties { ... };
614 };
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631 Methods
632 Terminate() and ActivateSession() work similar to TerminateSeat(),
633 ActivationSessionOnSeat() on the Manager object.
634
635 SwitchTo() switches to the session on the virtual terminal vtnr.
636 SwitchToNext() and SwitchToPrevious() switch to, respectively, the next
637 and previous sessions on the seat in the order of virtual terminals. If
638 there is no active session, they switch to, respectively, the first and
639 last session on the seat.
640
641 Signals
642 Whenever ActiveSession, Sessions, CanGraphical, CanTTY, or the idle
643 state changes, PropertyChanged signals are sent out to which clients
644 can subscribe.
645
646 Properties
647 The Id property encodes the ID of the seat.
648
649 ActiveSession encodes the currently active session if there is one. It
650 is a structure consisting of the session id and the object path.
651
652 CanTTY encodes whether the session is suitable for text logins, and
653 CanGraphical whether it is suitable for graphical sessions.
654
655 The Sessions property is an array of all current sessions of this seat,
656 each encoded in a structure consisting of the ID and the object path.
657
658 The IdleHint, IdleSinceHint, and IdleSinceHintMonotonic properties
659 encode the idle state, similar to the ones exposed on the Manager
660 object, but specific for this seat.
661
663 node /org/freedesktop/login1/user/_1000 {
664 interface org.freedesktop.login1.User {
665 methods:
666 Terminate();
667 Kill(in i signal_number);
668 properties:
669 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
670 readonly u UID = ...;
671 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
672 readonly u GID = ...;
673 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
674 readonly s Name = '...';
675 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
676 readonly t Timestamp = ...;
677 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
678 readonly t TimestampMonotonic = ...;
679 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
680 readonly s RuntimePath = '...';
681 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
682 readonly s Service = '...';
683 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
684 readonly s Slice = '...';
685 readonly (so) Display = ...;
686 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
687 readonly s State = '...';
688 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
689 readonly a(so) Sessions = [...];
690 readonly b IdleHint = ...;
691 readonly t IdleSinceHint = ...;
692 readonly t IdleSinceHintMonotonic = ...;
693 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
694 readonly b Linger = ...;
695 };
696 interface org.freedesktop.DBus.Peer { ... };
697 interface org.freedesktop.DBus.Introspectable { ... };
698 interface org.freedesktop.DBus.Properties { ... };
699 };
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720 Methods
721 Terminate() and Kill() work similar to the TerminateUser() and
722 KillUser() methods on the manager object.
723
724 Signals
725 Whenever Sessions or the idle state changes, PropertyChanged signals
726 are sent out to which clients can subscribe.
727
728 Properties
729 The UID and GID properties encode the Unix UID and primary GID of the
730 user.
731
732 The Name property encodes the user name.
733
734 Timestamp and TimestampMonotonic encode the login time of the user in
735 microseconds since the epoch, in the CLOCK_REALTIME and CLOCK_MONOTONIC
736 clocks, respectively.
737
738 RuntimePath encodes the runtime path of the user, i.e.
739 $XDG_RUNTIME_DIR. For details see the XDG Basedir Specification[4].
740
741 Service contains the unit name of the user systemd service of this
742 user. Each logged in user is assigned a user service that runs a user
743 systemd instance. This is usually an instance of user@.service.
744
745 Slice contains the unit name of the user systemd slice of this user.
746 Each logged in user gets a private slice.
747
748 Display encodes which graphical session should be used as the primary
749 UI display for the user. It is a structure encoding the session ID and
750 the object path of the session to use.
751
752 State encodes the user state and is one of "offline", "lingering",
753 "online", "active", or "closing". See sd_uid_get_state(3) for more
754 information about the states.
755
756 Sessions is an array of structures encoding all current sessions of the
757 user. Each structure consists of the ID and object path.
758
759 The IdleHint, IdleSinceHint, and IdleSinceHintMonotonic properties
760 encode the idle hint state of the user, similar to the Manager's
761 properties, but specific for this user.
762
763 The Linger property shows whether lingering is enabled for this user.
764
766 node /org/freedesktop/login1/session/1 {
767 interface org.freedesktop.login1.Session {
768 methods:
769 Terminate();
770 Activate();
771 Lock();
772 Unlock();
773 SetIdleHint(in b idle);
774 SetLockedHint(in b locked);
775 Kill(in s who,
776 in i signal_number);
777 TakeControl(in b force);
778 ReleaseControl();
779 SetType(in s type);
780 TakeDevice(in u major,
781 in u minor,
782 out h fd,
783 out b inactive);
784 ReleaseDevice(in u major,
785 in u minor);
786 PauseDeviceComplete(in u major,
787 in u minor);
788 SetBrightness(in s subsystem,
789 in s name,
790 in u brightness);
791 signals:
792 PauseDevice(u major,
793 u minor,
794 s type);
795 ResumeDevice(u major,
796 u minor,
797 h fd);
798 Lock();
799 Unlock();
800 properties:
801 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
802 readonly s Id = '...';
803 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
804 readonly (uo) User = ...;
805 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
806 readonly s Name = '...';
807 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
808 readonly t Timestamp = ...;
809 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
810 readonly t TimestampMonotonic = ...;
811 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
812 readonly u VTNr = ...;
813 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
814 readonly (so) Seat = ...;
815 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
816 readonly s TTY = '...';
817 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
818 readonly s Display = '...';
819 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
820 readonly b Remote = ...;
821 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
822 readonly s RemoteHost = '...';
823 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
824 readonly s RemoteUser = '...';
825 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
826 readonly s Service = '...';
827 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
828 readonly s Desktop = '...';
829 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
830 readonly s Scope = '...';
831 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
832 readonly u Leader = ...;
833 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
834 readonly u Audit = ...;
835 readonly s Type = '...';
836 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
837 readonly s Class = '...';
838 readonly b Active = ...;
839 readonly s State = '...';
840 readonly b IdleHint = ...;
841 readonly t IdleSinceHint = ...;
842 readonly t IdleSinceHintMonotonic = ...;
843 readonly b LockedHint = ...;
844 };
845 interface org.freedesktop.DBus.Peer { ... };
846 interface org.freedesktop.DBus.Introspectable { ... };
847 interface org.freedesktop.DBus.Properties { ... };
848 };
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895 Methods
896 Terminate(), Activate(), Lock(), Unlock(), and Kill() work similarly to
897 the respective calls on the Manager object.
898
899 SetIdleHint() is called by the session object to update the idle state
900 of the session whenever it changes.
901
902 TakeControl() allows a process to take exclusive managed device
903 access-control for that session. Only one D-Bus connection can be a
904 controller for a given session at any time. If the force argument is
905 set (root only), an existing controller is kicked out and replaced.
906 Otherwise, this method fails if there is already a controller. Note
907 that this method is limited to D-Bus users with the effective UID set
908 to the user of the session or root.
909
910 ReleaseControl() drops control of a given session. Closing the D-Bus
911 connection implicitly releases control as well. See TakeControl() for
912 more information. This method also releases all devices for which the
913 controller requested ownership via TakeDevice().
914
915 SetType() allows the type of the session to be changed dynamically. It
916 can only be called by session's current controller. If TakeControl()
917 has not been called, this method will fail. In addition, the session
918 type will be reset to its original value once control is released,
919 either by calling ReleaseControl() or closing the D-Bus connection.
920 This should help prevent a session from entering an inconsistent state,
921 for example if the controller crashes. The only argument type is the
922 new session type.
923
924 TakeDevice() allows a session controller to get a file descriptor for a
925 specific device. Pass in the major and minor numbers of the character
926 device and systemd-logind will return a file descriptor for the device.
927 Only a limited set of device-types is currently supported (but may be
928 extended). systemd-logind automatically mutes the file descriptor if
929 the session is inactive and resumes it once the session is activated
930 again. This guarantees that a session can only access session devices
931 if the session is active. Note that this revoke/resume mechanism is
932 asynchronous and may happen at any given time. This only works on
933 devices that are attached to the seat of the given session. A process
934 is not required to have direct access to the device node.
935 systemd-logind only requires you to be the active session controller
936 (see TakeControl()). Also note that any device can only be requested
937 once. As long as you don't release it, further TakeDevice() calls will
938 fail.
939
940 ReleaseDevice() releases a device again (see TakeDevice()). This is
941 also implicitly done by ReleaseControl() or when closing the D-Bus
942 connection.
943
944 PauseDeviceComplete() allows a session controller to synchronously
945 pause a device after receiving a PauseDevice("pause") signal. Forced
946 signals (or after an internal timeout) are automatically completed by
947 systemd-logind asynchronously.
948
949 SetLockedHint() may be used to set the "locked hint" to locked, i.e.
950 information whether the session is locked. This is intended to be used
951 by the desktop environment to tell systemd-logind when the session is
952 locked and unlocked.
953
954 SetBrightness() may be used to set the display brightness. This is
955 intended to be used by the desktop environment and allows unprivileged
956 programs to access hardware settings in a controlled way. The subsystem
957 parameter specifies a kernel subsystem, either "backlight" or "leds".
958 The name parameter specifies a device name under the specified
959 subsystem. The brightness parameter specifies the brightness. The range
960 is defined by individual drivers, see
961 /sys/class/subsystem/name/max_brightness.
962
963 Signals
964 The active session controller exclusively gets PauseDevice and
965 ResumeDevice events for any device it requested via TakeDevice(). They
966 notify the controller whenever a device is paused or resumed. A device
967 is never resumed if its session is inactive. Also note that PauseDevice
968 signals are sent before the PropertyChanged signal for the Active
969 state. The inverse is true for ResumeDevice. A device may remain paused
970 for unknown reasons even though the Session is active.
971
972 A PauseDevice signal carries the major and minor numbers and a string
973 describing the type as arguments. force means the device was already
974 paused by systemd-logind and the signal is only an asynchronous
975 notification. pause means systemd-logind grants you a limited amount
976 of time to pause the device. You must respond to this via
977 PauseDeviceComplete(). This synchronous pausing mechanism is used for
978 backwards-compatibility to VTs and systemd-logind is free to not make
979 use of it. It is also free to send a forced PauseDevice if you don't
980 respond in a timely manner (or for any other reason). gone means the
981 device was unplugged from the system and you will no longer get any
982 notifications about it. There is no need to call ReleaseDevice(). You
983 may call TakeDevice() again if a new device is assigned the major+minor
984 combination.
985
986 ResumeDevice is sent whenever a session is active and a device is
987 resumed. It carries the major/minor numbers as arguments and provides a
988 new open file descriptor. You should switch to the new descriptor and
989 close the old one. They are not guaranteed to have the same underlying
990 open file descriptor in the kernel (except for a limited set of device
991 types).
992
993 Whenever Active or the idle state changes, PropertyChanged signals are
994 sent out to which clients can subscribe.
995
996 Lock/Unlock is sent when the session is asked to be
997 screen-locked/unlocked. A session manager of the session should listen
998 to this signal and act accordingly. This signal is sent out as a result
999 of the Lock() and Unlock() methods, respectively.
1000
1001 Properties
1002 Id encodes the session ID.
1003
1004 User encodes the user ID of the user this session belongs to. This is a
1005 structure consisting of the Unix UID and the object path.
1006
1007 Name encodes the user name.
1008
1009 Timestamp and TimestampMonotonic encode the microseconds since the
1010 epoch when the session was created, in CLOCK_REALTIME or
1011 CLOCK_MONOTONIC, respectively.
1012
1013 VTNr encodes the virtual terminal number of the session if there is
1014 any, 0 otherwise.
1015
1016 Seat encodes the seat this session belongs to if there is any. This is
1017 a structure consisting of the ID and the seat object path.
1018
1019 TTY encodes the kernel TTY path of the session if this is a text login.
1020 If not this is an empty string.
1021
1022 Display encodes the X11 display name if this is a graphical login. If
1023 not, this is an empty string.
1024
1025 Remote encodes whether the session is local or remote.
1026
1027 RemoteHost and RemoteUser encode the remote host and user if this is a
1028 remote session, or an empty string otherwise.
1029
1030 Service encodes the PAM service name that registered the session.
1031
1032 Desktop describes the desktop environment running in the session (if
1033 known).
1034
1035 Scope contains the systemd scope unit name of this session.
1036
1037 Leader encodes the PID of the process that registered the session.
1038
1039 Audit encodes the Kernel Audit session ID of the session if auditing is
1040 available.
1041
1042 Type encodes the session type. It's one of "unspecified" (for cron PAM
1043 sessions and suchlike), "tty" (for text logins) or
1044 "x11"/"mir"/"wayland" (for graphical logins).
1045
1046 Class encodes the session class. It's one of "user" (for normal user
1047 sessions), "greeter" (for display manager pseudo-sessions), or
1048 "lock-screen" (for display lock screens).
1049
1050 Active is a boolean that is true if the session is active, i.e.
1051 currently in the foreground. This field is semi-redundant due to State.
1052
1053 State encodes the session state and one of "online", "active", or
1054 "closing". See sd_session_get_state(3) for more information about the
1055 states.
1056
1057 IdleHint, IdleSinceHint, and IdleSinceHintMonotonic encapsulate the
1058 idle hint state of this session, similarly to how the respective
1059 properties on the manager object do it for the whole system.
1060
1061 LockedHint shows the locked hint state of this session, as set by the
1062 SetLockedHint() method described above.
1063
1065 Example 1. Introspect org.freedesktop.login1.Manager on the bus
1066
1067 $ gdbus introspect --system --dest org.freedesktop.login1 \
1068 --object-path /org/freedesktop/login1
1069
1070
1071 Example 2. Introspect org.freedesktop.login1.Seat on the bus
1072
1073 $ gdbus introspect --system --dest org.freedesktop.login1 \
1074 --object-path /org/freedesktop/login1/seat/seat0
1075
1076
1077 Example 3. Introspect org.freedesktop.login1.User on the bus
1078
1079 $ gdbus introspect --system --dest org.freedesktop.login1 \
1080 --object-path /org/freedesktop/login1/user/_1000
1081
1082
1083 Example 4. Introspect org.freedesktop.login1.Session on the bus
1084
1085 $ gdbus introspect --system --dest org.freedesktop.login1 \
1086 --object-path /org/freedesktop/login1/session/45
1087
1088
1090 These D-Bus interfaces follow the usual interface versioning
1091 guidelines[5].
1092
1094 1. polkit
1095 https://www.freedesktop.org/software/polkit/docs/latest/
1096
1097 2. Multi-Seat for Linux
1098 https://www.freedesktop.org/wiki/Software/systemd/multiseat
1099
1100 3. Inhibitor Locks
1101 http://www.freedesktop.org/wiki/Software/systemd/inhibit
1102
1103 4. XDG Basedir Specification
1104 https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
1105
1106 5. the usual interface versioning guidelines
1107 http://0pointer.de/blog/projects/versioning-dbus.html
1108
1109
1110
1111systemd 246 ORG.FREEDESKTOP.LOGIN1(5)