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