Debian Codegraph @

man/org.freedesktop.login1.xml

raw
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" >
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6 <refentry id="org.freedesktop.login1" conditional='ENABLE_LOGIND'
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8 <refentryinfo>
9 <title>org.freedesktop.login1</title>
10 <productname>systemd</productname>
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>org.freedesktop.login1</refentrytitle>
15 <manvolnum>5</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>org.freedesktop.login1</refname>
20 <refpurpose>The D-Bus interface of systemd-logind</refpurpose>
21 </refnamediv>
22
23 <refsect1>
24 <title>Introduction</title>
25
26 <para><citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
27 is a system service that keeps track of user logins and seats.</para>
28
29 <para>The daemon provides both a C library interface as well as a D-Bus interface. The library interface
30 may be used to introspect and watch the state of user logins and seats. The bus interface provides the
31 same functionality but in addition may also be used to make changes to the system state. For more information please
32 consult <citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
33 </para>
34 </refsect1>
35
36 <refsect1>
37 <title>The Manager Object</title>
38
39 <para>The service exposes the following interfaces on the Manager object on the bus:</para>
40
41 <programlisting executable="systemd-logind" node="/org/freedesktop/login1" interface="org.freedesktop.login1.Manager">
42 node /org/freedesktop/login1 {
43 interface org.freedesktop.login1.Manager {
44 methods:
45 GetSession(in s session_id,
46 out o object_path);
47 GetSessionByPID(in u pid,
48 out o object_path);
49 GetUser(in u uid,
50 out o object_path);
51 GetUserByPID(in u pid,
52 out o object_path);
53 GetSeat(in s seat_id,
54 out o object_path);
55 ListSessions(out a(susso) sessions);
56 ListSessionsEx(out a(sussussbto) sessions);
57 ListUsers(out a(uso) users);
58 ListSeats(out a(so) seats);
59 ListInhibitors(out a(ssssuu) inhibitors);
60 @org.freedesktop.systemd1.Privileged("true")
61 CreateSession(in u uid,
62 in u pid,
63 in s service,
64 in s type,
65 in s class,
66 in s desktop,
67 in s seat_id,
68 in u vtnr,
69 in s tty,
70 in s display,
71 in b remote,
72 in s remote_user,
73 in s remote_host,
74 in a(sv) properties,
75 out s session_id,
76 out o object_path,
77 out s runtime_path,
78 out h fifo_fd,
79 out u uid,
80 out s seat_id,
81 out u vtnr,
82 out b existing);
83 @org.freedesktop.systemd1.Privileged("true")
84 CreateSessionWithPIDFD(in u uid,
85 in h pidfd,
86 in s service,
87 in s type,
88 in s class,
89 in s desktop,
90 in s seat_id,
91 in u vtnr,
92 in s tty,
93 in s display,
94 in b remote,
95 in s remote_user,
96 in s remote_host,
97 in t flags,
98 in a(sv) properties,
99 out s session_id,
100 out o object_path,
101 out s runtime_path,
102 out h fifo_fd,
103 out u uid,
104 out s seat_id,
105 out u vtnr,
106 out b existing);
107 ReleaseSession(in s session_id);
108 ActivateSession(in s session_id);
109 ActivateSessionOnSeat(in s session_id,
110 in s seat_id);
111 LockSession(in s session_id);
112 UnlockSession(in s session_id);
113 LockSessions();
114 UnlockSessions();
115 KillSession(in s session_id,
116 in s whom,
117 in i signal_number);
118 KillUser(in u uid,
119 in i signal_number);
120 TerminateSession(in s session_id);
121 TerminateUser(in u uid);
122 TerminateSeat(in s seat_id);
123 SetUserLinger(in u uid,
124 in b enable,
125 in b interactive);
126 AttachDevice(in s seat_id,
127 in s sysfs_path,
128 in b interactive);
129 FlushDevices(in b interactive);
130 PowerOff(in b interactive);
131 PowerOffWithFlags(in t flags);
132 Reboot(in b interactive);
133 RebootWithFlags(in t flags);
134 Halt(in b interactive);
135 HaltWithFlags(in t flags);
136 Suspend(in b interactive);
137 SuspendWithFlags(in t flags);
138 Hibernate(in b interactive);
139 HibernateWithFlags(in t flags);
140 HybridSleep(in b interactive);
141 HybridSleepWithFlags(in t flags);
142 SuspendThenHibernate(in b interactive);
143 SuspendThenHibernateWithFlags(in t flags);
144 Sleep(in t flags);
145 CanPowerOff(out s result);
146 CanReboot(out s result);
147 CanHalt(out s result);
148 CanSuspend(out s result);
149 CanHibernate(out s result);
150 CanHybridSleep(out s result);
151 CanSuspendThenHibernate(out s result);
152 CanSleep(out s result);
153 ScheduleShutdown(in s type,
154 in t usec);
155 CancelScheduledShutdown(out b cancelled);
156 Inhibit(in s what,
157 in s who,
158 in s why,
159 in s mode,
160 out h pipe_fd);
161 CanRebootParameter(out s result);
162 SetRebootParameter(in s parameter);
163 CanRebootToFirmwareSetup(out s result);
164 SetRebootToFirmwareSetup(in b enable);
165 CanRebootToBootLoaderMenu(out s result);
166 SetRebootToBootLoaderMenu(in t timeout);
167 CanRebootToBootLoaderEntry(out s result);
168 SetRebootToBootLoaderEntry(in s boot_loader_entry);
169 SetWallMessage(in s wall_message,
170 in b enable);
171 signals:
172 SecureAttentionKey(s seat_id,
173 o object_path);
174 SessionNew(s session_id,
175 o object_path);
176 SessionRemoved(s session_id,
177 o object_path);
178 UserNew(u uid,
179 o object_path);
180 UserRemoved(u uid,
181 o object_path);
182 SeatNew(s seat_id,
183 o object_path);
184 SeatRemoved(s seat_id,
185 o object_path);
186 PrepareForShutdown(b start);
187 PrepareForShutdownWithMetadata(b start,
188 a{sv} metadata);
189 PrepareForSleep(b start);
190 properties:
191 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
192 @org.freedesktop.systemd1.Privileged("true")
193 readwrite b EnableWallMessages = ...;
194 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
195 @org.freedesktop.systemd1.Privileged("true")
196 readwrite s WallMessage = '...';
197 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
198 readonly u NAutoVTs = ...;
199 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
200 readonly as KillOnlyUsers = ['...', ...];
201 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
202 readonly as KillExcludeUsers = ['...', ...];
203 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
204 readonly b KillUserProcesses = ...;
205 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
206 readonly s RebootParameter = '...';
207 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
208 readonly b RebootToFirmwareSetup = ...;
209 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
210 readonly t RebootToBootLoaderMenu = ...;
211 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
212 readonly s RebootToBootLoaderEntry = '...';
213 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
214 readonly as BootLoaderEntries = ['...', ...];
215 readonly b IdleHint = ...;
216 readonly t IdleSinceHint = ...;
217 readonly t IdleSinceHintMonotonic = ...;
218 readonly s BlockInhibited = '...';
219 readonly s BlockWeakInhibited = '...';
220 readonly s DelayInhibited = '...';
221 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
222 readonly t InhibitDelayMaxUSec = ...;
223 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
224 readonly t UserStopDelayUSec = ...;
225 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
226 readonly as SleepOperation = ['...', ...];
227 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
228 readonly s HandlePowerKey = '...';
229 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
230 readonly s HandlePowerKeyLongPress = '...';
231 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
232 readonly s HandleRebootKey = '...';
233 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
234 readonly s HandleRebootKeyLongPress = '...';
235 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
236 readonly s HandleSuspendKey = '...';
237 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
238 readonly s HandleSuspendKeyLongPress = '...';
239 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
240 readonly s HandleHibernateKey = '...';
241 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
242 readonly s HandleHibernateKeyLongPress = '...';
243 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
244 readonly s HandleLidSwitch = '...';
245 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
246 readonly s HandleLidSwitchExternalPower = '...';
247 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
248 readonly s HandleLidSwitchDocked = '...';
249 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
250 readonly s HandleSecureAttentionKey = '...';
251 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
252 readonly t HoldoffTimeoutUSec = ...;
253 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
254 readonly s IdleAction = '...';
255 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
256 readonly t IdleActionUSec = ...;
257 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
258 readonly b PreparingForShutdown = ...;
259 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
260 readonly a{sv} PreparingForShutdownWithMetadata = [...];
261 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
262 readonly b PreparingForSleep = ...;
263 readonly (st) ScheduledShutdown = ...;
264 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
265 readonly s DesignatedMaintenanceTime = '...';
266 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
267 readonly b Docked = ...;
268 readonly b LidClosed = ...;
269 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
270 readonly b OnExternalPower = ...;
271 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
272 readonly b RemoveIPC = ...;
273 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
274 readonly t RuntimeDirectorySize = ...;
275 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
276 readonly t RuntimeDirectoryInodesMax = ...;
277 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
278 readonly t InhibitorsMax = ...;
279 readonly t NCurrentInhibitors = ...;
280 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
281 readonly t SessionsMax = ...;
282 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
283 readonly t NCurrentSessions = ...;
284 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
285 readonly t StopIdleSessionUSec = ...;
286 };
287 interface org.freedesktop.DBus.Peer { ... };
288 interface org.freedesktop.DBus.Introspectable { ... };
289 interface org.freedesktop.DBus.Properties { ... };
290 };
291 </programlisting>
292
293 <!--property SleepOperation is not documented!-->
294
295 <!--property HandlePowerKeyLongPress is not documented!-->
296
297 <!--property HandleRebootKey is not documented!-->
298
299 <!--property HandleRebootKeyLongPress is not documented!-->
300
301 <!--property HandleSuspendKeyLongPress is not documented!-->
302
303 <!--property HandleHibernateKeyLongPress is not documented!-->
304
305 <!--property HandleSecureAttentionKey is not documented!-->
306
307 <!--property DesignatedMaintenanceTime is not documented!-->
308
309 <!--property StopIdleSessionUSec is not documented!-->
310
311 <!--Autogenerated cross-references for systemd.directives, do not edit-->
312
313 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.login1.Manager"/>
314
315 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.login1.Manager"/>
316
317 <variablelist class="dbus-method" generated="True" extra-ref="GetSession()"/>
318
319 <variablelist class="dbus-method" generated="True" extra-ref="GetSessionByPID()"/>
320
321 <variablelist class="dbus-method" generated="True" extra-ref="GetUser()"/>
322
323 <variablelist class="dbus-method" generated="True" extra-ref="GetUserByPID()"/>
324
325 <variablelist class="dbus-method" generated="True" extra-ref="GetSeat()"/>
326
327 <variablelist class="dbus-method" generated="True" extra-ref="ListSessions()"/>
328
329 <variablelist class="dbus-method" generated="True" extra-ref="ListSessionsEx()"/>
330
331 <variablelist class="dbus-method" generated="True" extra-ref="ListUsers()"/>
332
333 <variablelist class="dbus-method" generated="True" extra-ref="ListSeats()"/>
334
335 <variablelist class="dbus-method" generated="True" extra-ref="ListInhibitors()"/>
336
337 <variablelist class="dbus-method" generated="True" extra-ref="CreateSession()"/>
338
339 <variablelist class="dbus-method" generated="True" extra-ref="CreateSessionWithPIDFD()"/>
340
341 <variablelist class="dbus-method" generated="True" extra-ref="ReleaseSession()"/>
342
343 <variablelist class="dbus-method" generated="True" extra-ref="ActivateSession()"/>
344
345 <variablelist class="dbus-method" generated="True" extra-ref="ActivateSessionOnSeat()"/>
346
347 <variablelist class="dbus-method" generated="True" extra-ref="LockSession()"/>
348
349 <variablelist class="dbus-method" generated="True" extra-ref="UnlockSession()"/>
350
351 <variablelist class="dbus-method" generated="True" extra-ref="LockSessions()"/>
352
353 <variablelist class="dbus-method" generated="True" extra-ref="UnlockSessions()"/>
354
355 <variablelist class="dbus-method" generated="True" extra-ref="KillSession()"/>
356
357 <variablelist class="dbus-method" generated="True" extra-ref="KillUser()"/>
358
359 <variablelist class="dbus-method" generated="True" extra-ref="TerminateSession()"/>
360
361 <variablelist class="dbus-method" generated="True" extra-ref="TerminateUser()"/>
362
363 <variablelist class="dbus-method" generated="True" extra-ref="TerminateSeat()"/>
364
365 <variablelist class="dbus-method" generated="True" extra-ref="SetUserLinger()"/>
366
367 <variablelist class="dbus-method" generated="True" extra-ref="AttachDevice()"/>
368
369 <variablelist class="dbus-method" generated="True" extra-ref="FlushDevices()"/>
370
371 <variablelist class="dbus-method" generated="True" extra-ref="PowerOff()"/>
372
373 <variablelist class="dbus-method" generated="True" extra-ref="PowerOffWithFlags()"/>
374
375 <variablelist class="dbus-method" generated="True" extra-ref="Reboot()"/>
376
377 <variablelist class="dbus-method" generated="True" extra-ref="RebootWithFlags()"/>
378
379 <variablelist class="dbus-method" generated="True" extra-ref="Halt()"/>
380
381 <variablelist class="dbus-method" generated="True" extra-ref="HaltWithFlags()"/>
382
383 <variablelist class="dbus-method" generated="True" extra-ref="Suspend()"/>
384
385 <variablelist class="dbus-method" generated="True" extra-ref="SuspendWithFlags()"/>
386
387 <variablelist class="dbus-method" generated="True" extra-ref="Hibernate()"/>
388
389 <variablelist class="dbus-method" generated="True" extra-ref="HibernateWithFlags()"/>
390
391 <variablelist class="dbus-method" generated="True" extra-ref="HybridSleep()"/>
392
393 <variablelist class="dbus-method" generated="True" extra-ref="HybridSleepWithFlags()"/>
394
395 <variablelist class="dbus-method" generated="True" extra-ref="SuspendThenHibernate()"/>
396
397 <variablelist class="dbus-method" generated="True" extra-ref="SuspendThenHibernateWithFlags()"/>
398
399 <variablelist class="dbus-method" generated="True" extra-ref="Sleep()"/>
400
401 <variablelist class="dbus-method" generated="True" extra-ref="CanPowerOff()"/>
402
403 <variablelist class="dbus-method" generated="True" extra-ref="CanReboot()"/>
404
405 <variablelist class="dbus-method" generated="True" extra-ref="CanHalt()"/>
406
407 <variablelist class="dbus-method" generated="True" extra-ref="CanSuspend()"/>
408
409 <variablelist class="dbus-method" generated="True" extra-ref="CanHibernate()"/>
410
411 <variablelist class="dbus-method" generated="True" extra-ref="CanHybridSleep()"/>
412
413 <variablelist class="dbus-method" generated="True" extra-ref="CanSuspendThenHibernate()"/>
414
415 <variablelist class="dbus-method" generated="True" extra-ref="CanSleep()"/>
416
417 <variablelist class="dbus-method" generated="True" extra-ref="ScheduleShutdown()"/>
418
419 <variablelist class="dbus-method" generated="True" extra-ref="CancelScheduledShutdown()"/>
420
421 <variablelist class="dbus-method" generated="True" extra-ref="Inhibit()"/>
422
423 <variablelist class="dbus-method" generated="True" extra-ref="CanRebootParameter()"/>
424
425 <variablelist class="dbus-method" generated="True" extra-ref="SetRebootParameter()"/>
426
427 <variablelist class="dbus-method" generated="True" extra-ref="CanRebootToFirmwareSetup()"/>
428
429 <variablelist class="dbus-method" generated="True" extra-ref="SetRebootToFirmwareSetup()"/>
430
431 <variablelist class="dbus-method" generated="True" extra-ref="CanRebootToBootLoaderMenu()"/>
432
433 <variablelist class="dbus-method" generated="True" extra-ref="SetRebootToBootLoaderMenu()"/>
434
435 <variablelist class="dbus-method" generated="True" extra-ref="CanRebootToBootLoaderEntry()"/>
436
437 <variablelist class="dbus-method" generated="True" extra-ref="SetRebootToBootLoaderEntry()"/>
438
439 <variablelist class="dbus-method" generated="True" extra-ref="SetWallMessage()"/>
440
441 <variablelist class="dbus-signal" generated="True" extra-ref="SecureAttentionKey()"/>
442
443 <variablelist class="dbus-signal" generated="True" extra-ref="SessionNew()"/>
444
445 <variablelist class="dbus-signal" generated="True" extra-ref="SessionRemoved()"/>
446
447 <variablelist class="dbus-signal" generated="True" extra-ref="UserNew()"/>
448
449 <variablelist class="dbus-signal" generated="True" extra-ref="UserRemoved()"/>
450
451 <variablelist class="dbus-signal" generated="True" extra-ref="SeatNew()"/>
452
453 <variablelist class="dbus-signal" generated="True" extra-ref="SeatRemoved()"/>
454
455 <variablelist class="dbus-signal" generated="True" extra-ref="PrepareForShutdown()"/>
456
457 <variablelist class="dbus-signal" generated="True" extra-ref="PrepareForShutdownWithMetadata()"/>
458
459 <variablelist class="dbus-signal" generated="True" extra-ref="PrepareForSleep()"/>
460
461 <variablelist class="dbus-property" generated="True" extra-ref="EnableWallMessages"/>
462
463 <variablelist class="dbus-property" generated="True" extra-ref="WallMessage"/>
464
465 <variablelist class="dbus-property" generated="True" extra-ref="NAutoVTs"/>
466
467 <variablelist class="dbus-property" generated="True" extra-ref="KillOnlyUsers"/>
468
469 <variablelist class="dbus-property" generated="True" extra-ref="KillExcludeUsers"/>
470
471 <variablelist class="dbus-property" generated="True" extra-ref="KillUserProcesses"/>
472
473 <variablelist class="dbus-property" generated="True" extra-ref="RebootParameter"/>
474
475 <variablelist class="dbus-property" generated="True" extra-ref="RebootToFirmwareSetup"/>
476
477 <variablelist class="dbus-property" generated="True" extra-ref="RebootToBootLoaderMenu"/>
478
479 <variablelist class="dbus-property" generated="True" extra-ref="RebootToBootLoaderEntry"/>
480
481 <variablelist class="dbus-property" generated="True" extra-ref="BootLoaderEntries"/>
482
483 <variablelist class="dbus-property" generated="True" extra-ref="IdleHint"/>
484
485 <variablelist class="dbus-property" generated="True" extra-ref="IdleSinceHint"/>
486
487 <variablelist class="dbus-property" generated="True" extra-ref="IdleSinceHintMonotonic"/>
488
489 <variablelist class="dbus-property" generated="True" extra-ref="BlockInhibited"/>
490
491 <variablelist class="dbus-property" generated="True" extra-ref="BlockWeakInhibited"/>
492
493 <variablelist class="dbus-property" generated="True" extra-ref="DelayInhibited"/>
494
495 <variablelist class="dbus-property" generated="True" extra-ref="InhibitDelayMaxUSec"/>
496
497 <variablelist class="dbus-property" generated="True" extra-ref="UserStopDelayUSec"/>
498
499 <variablelist class="dbus-property" generated="True" extra-ref="SleepOperation"/>
500
501 <variablelist class="dbus-property" generated="True" extra-ref="HandlePowerKey"/>
502
503 <variablelist class="dbus-property" generated="True" extra-ref="HandlePowerKeyLongPress"/>
504
505 <variablelist class="dbus-property" generated="True" extra-ref="HandleRebootKey"/>
506
507 <variablelist class="dbus-property" generated="True" extra-ref="HandleRebootKeyLongPress"/>
508
509 <variablelist class="dbus-property" generated="True" extra-ref="HandleSuspendKey"/>
510
511 <variablelist class="dbus-property" generated="True" extra-ref="HandleSuspendKeyLongPress"/>
512
513 <variablelist class="dbus-property" generated="True" extra-ref="HandleHibernateKey"/>
514
515 <variablelist class="dbus-property" generated="True" extra-ref="HandleHibernateKeyLongPress"/>
516
517 <variablelist class="dbus-property" generated="True" extra-ref="HandleLidSwitch"/>
518
519 <variablelist class="dbus-property" generated="True" extra-ref="HandleLidSwitchExternalPower"/>
520
521 <variablelist class="dbus-property" generated="True" extra-ref="HandleLidSwitchDocked"/>
522
523 <variablelist class="dbus-property" generated="True" extra-ref="HandleSecureAttentionKey"/>
524
525 <variablelist class="dbus-property" generated="True" extra-ref="HoldoffTimeoutUSec"/>
526
527 <variablelist class="dbus-property" generated="True" extra-ref="IdleAction"/>
528
529 <variablelist class="dbus-property" generated="True" extra-ref="IdleActionUSec"/>
530
531 <variablelist class="dbus-property" generated="True" extra-ref="PreparingForShutdown"/>
532
533 <variablelist class="dbus-property" generated="True" extra-ref="PreparingForShutdownWithMetadata"/>
534
535 <variablelist class="dbus-property" generated="True" extra-ref="PreparingForSleep"/>
536
537 <variablelist class="dbus-property" generated="True" extra-ref="ScheduledShutdown"/>
538
539 <variablelist class="dbus-property" generated="True" extra-ref="DesignatedMaintenanceTime"/>
540
541 <variablelist class="dbus-property" generated="True" extra-ref="Docked"/>
542
543 <variablelist class="dbus-property" generated="True" extra-ref="LidClosed"/>
544
545 <variablelist class="dbus-property" generated="True" extra-ref="OnExternalPower"/>
546
547 <variablelist class="dbus-property" generated="True" extra-ref="RemoveIPC"/>
548
549 <variablelist class="dbus-property" generated="True" extra-ref="RuntimeDirectorySize"/>
550
551 <variablelist class="dbus-property" generated="True" extra-ref="RuntimeDirectoryInodesMax"/>
552
553 <variablelist class="dbus-property" generated="True" extra-ref="InhibitorsMax"/>
554
555 <variablelist class="dbus-property" generated="True" extra-ref="NCurrentInhibitors"/>
556
557 <variablelist class="dbus-property" generated="True" extra-ref="SessionsMax"/>
558
559 <variablelist class="dbus-property" generated="True" extra-ref="NCurrentSessions"/>
560
561 <variablelist class="dbus-property" generated="True" extra-ref="StopIdleSessionUSec"/>
562
563 <!--End of Autogenerated section-->
564
565 <refsect2>
566 <title>Methods</title>
567
568 <para><function>GetSession()</function> may be used to get the session object path for the session with
569 the specified ID. Similarly, <function>GetUser()</function> and <function>GetSeat()</function> get the
570 user and seat objects, respectively. <function>GetSessionByPID()</function> and
571 <function>GetUserByPID()</function> get the session/user object the specified PID belongs to if there
572 is any.</para>
573
574 <para><function>ListSessions()</function> returns an array of all current sessions. The structures in
575 the array consist of the following fields: <varname>session id</varname>, <varname>user id</varname>,
576 <varname>user name</varname>, <varname>seat id</varname>, and <varname>session object path</varname>.
577 If a session does not have a seat attached, the seat id field will be an empty string.</para>
578
579 <para><function>ListSessionsEx()</function> returns an array of all current sessions with more metadata
580 than <function>ListSessions()</function>. The structures in the array consist of the following fields:
581 <varname>session id</varname>, <varname>user id</varname>, <varname>user name</varname>,
582 <varname>seat id</varname>, <varname>leader pid</varname>, <varname>session class</varname>,
583 <varname>tty name</varname>, <varname>idle hint</varname>, <varname>idle hint monotonic timestamp</varname>,
584 and <varname>session object path</varname>. <varname>tty</varname> and <varname>seat id</varname> fields
585 could be empty, if the session has no associated tty or session has no seat attached, respectively.</para>
586
587 <para><function>ListUsers()</function> returns an array of all currently logged in users. The
588 structures in the array consist of the following fields: user id, user name, user object path.</para>
589
590 <para><function>ListSeats()</function> returns an array of all currently available seats. The
591 structure in the array consists of the following fields: seat id, seat object path.</para>
592
593 <para><function>ListInhibitors()</function> lists all currently active inhibitors. It returns an array of
594 structures consisting of <varname>what</varname>, <varname>who</varname>, <varname>why</varname>,
595 <varname>mode</varname>, <varname>uid</varname> (user ID), and <varname>pid</varname> (process ID).</para>
596
597 <para><function>CreateSession()</function>, <function>CreateSessionWithPIDFD()</function>, and
598 <function>ReleaseSession()</function> may be used to open or close login sessions. These calls should
599 <emphasis>never</emphasis> be invoked directly by clients. Creating/closing sessions is exclusively the job
600 of PAM and its <citerefentry><refentrytitle>pam_systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
601 module.</para>
602
603 <para><function>ActivateSession()</function> brings the session with the specified ID into the
604 foreground. <function>ActivateSessionOnSeat()</function> does the same, but only if the seat id
605 matches.</para>
606
607 <para><function>LockSession()</function> asks the session with the specified ID to activate the screen
608 lock. <function>UnlockSession()</function> asks the session with the specified ID to remove an active
609 screen lock, if there is any. This is implemented by sending out the Lock() and Unlock() signals from
610 the respective session object which session managers are supposed to listen on.</para>
611
612 <para><function>LockSessions()</function> asks all sessions to activate their screen locks. This may be
613 used to lock access to the entire machine in one action. Similarly, <function>UnlockSessions()</function>
614 asks all sessions to deactivate their screen locks.</para>
615
616 <para><function>KillSession()</function> may be used to send a Unix signal to one or all processes of a
617 session. As arguments it takes the session id, either the string <literal>leader</literal> or
618 <literal>all</literal> and a signal number. If <literal>leader</literal> is passed only the session
619 <literal>leader</literal> is killed. If <literal>all</literal> is passed all processes of the session
620 are killed.</para>
621
622 <para><function>KillUser()</function> may be used to send a Unix signal to all processes of a user. As
623 arguments it takes the user id and a signal number.</para>
624
625 <para><function>TerminateSession()</function>, <function>TerminateUser()</function>,
626 <function>TerminateSeat()</function> may be used to forcibly terminate one specific session, all
627 processes of a user, and all sessions attached to a specific seat, respectively. The session, user,
628 and seat are identified by their respective IDs.</para>
629
630 <para><function>SetUserLinger()</function> enables or disables user lingering. If enabled, the runtime
631 directory of a user is kept around and they may continue to run processes while logged out. If
632 disabled, the runtime directory goes away as soon as they log out. <function>SetUserLinger()</function>
633 expects three arguments: the UID, a boolean whether to enable/disable and a boolean controlling the
634 <ulink url="https://www.freedesktop.org/software/polkit/docs/latest/">polkit</ulink>
635 authorization interactivity (see below). Note that the user linger state is persistently
636 stored on disk.</para>
637
638 <para><function>AttachDevice()</function> may be used to assign a specific device to a specific
639 seat. The device is identified by its <filename>/sys/</filename> path and must be eligible for seat
640 assignments. <function>AttachDevice()</function> takes three arguments: the seat id, the sysfs path,
641 and a boolean for controlling polkit interactivity (see below). Device assignments are persistently
642 stored on disk. To create a new seat, simply specify a previously unused seat id. For more information
643 about the seat assignment logic see
644 <citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
645
646 <para><function>FlushDevices()</function> removes all explicit seat assignments for devices, resetting
647 all assignments to the automatic defaults. The only argument it takes is the polkit interactivity
648 boolean (see below).</para>
649
650 <para><function>PowerOff()</function>, <function>Reboot()</function>, <function>Halt()</function>,
651 <function>Suspend()</function>, and <function>Hibernate()</function> result in the system being powered
652 off, rebooted, halted (shut down without turning off power), suspended (the system state is saved to
653 RAM and the CPU is turned off), or hibernated (the system state is saved to disk and the machine is
654 powered down). <function>HybridSleep()</function> results in the system entering a hybrid-sleep mode,
655 i.e. the system is both hibernated and suspended. <function>SuspendThenHibernate()</function> results
656 in the system being suspended, then later woken using an RTC timer and hibernated. The only argument is
657 the polkit interactivity boolean <varname>interactive</varname> (see below). The main purpose of these
658 calls is that they enforce polkit policy and hence allow powering off/rebooting/suspending/hibernating
659 even by unprivileged users. They also enforce inhibition locks for non-privileged users.
660 <function>Sleep()</function> automatically selects the most suitable sleep operation supported by the
661 machine. The candidate sleep operations to check for support can be configured through <varname>SleepOperation=</varname>
662 setting in <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
663 UIs should expose these calls as the primary mechanism to poweroff/reboot/suspend/hibernate the machine. Methods
664 <function>PowerOffWithFlags()</function>, <function>RebootWithFlags()</function>,
665 <function>HaltWithFlags()</function>, <function>SuspendWithFlags()</function>,
666 <function>HibernateWithFlags()</function>, <function>HybridSleepWithFlags()</function>,
667 <function>SuspendThenHibernateWithFlags()</function>, and <function>Sleep()</function> take
668 <varname>flags</varname> to allow for extendability, defined as follows:</para>
669 <programlisting>
670 #define SD_LOGIND_ROOT_CHECK_INHIBITORS (UINT64_C(1) &lt;&lt; 0)
671 #define SD_LOGIND_KEXEC_REBOOT (UINT64_C(1) &lt;&lt; 1)
672 #define SD_LOGIND_SOFT_REBOOT (UINT64_C(1) &lt;&lt; 2)
673 #define SD_LOGIND_SOFT_REBOOT_IF_NEXTROOT_SET_UP (UINT64_C(1) &lt;&lt; 3)
674 #define SD_LOGIND_SKIP_INHIBITORS (UINT64_C(1) &lt;&lt; 4)
675 </programlisting>
676 <para>When the <varname>flags</varname> is 0 then these methods behave just like the versions without
677 flags. Since systemd version 257 inhibitors of type <literal>block</literal> are enforced on operations
678 requested by both privileged and unprivileged users. Previously they were honoured only by unprivileged
679 users, excluding the user owning the inhibitor. The latter behaviour is now available through the
680 <literal>block-weak</literal> inhibitor lock type. <constant>SD_LOGIND_ROOT_CHECK_INHIBITORS</constant>
681 (0x01) makes <literal>block-weak</literal> locks behave like regular <literal>block</literal> locks,
682 i.e. ensures they are honoured for any user. A flag <constant>SD_LOGIND_SKIP_INHIBITORS</constant>
683 (0x10) can be specified to bypass both <literal>block</literal> and <literal>block-weak</literal>
684 inhibitors (it has no effect on <literal>delay</literal> inhibitors). When
685 <constant>SD_LOGIND_KEXEC_REBOOT</constant> (0x02) is set, then <function>RebootWithFlags()</function>
686 performs a kexec reboot if kexec kernel is loaded. When <constant>SD_LOGIND_SOFT_REBOOT</constant>
687 (0x04) is set, or <constant>SD_LOGIND_SOFT_REBOOT_IF_NEXTROOT_SET_UP</constant> (0x08) is set and a new
688 root file system has been set up on <literal>/run/nextroot/</literal>, then
689 <function>RebootWithFlags()</function> performs a userspace reboot
690 only. <constant>SD_LOGIND_SOFT_REBOOT_IF_NEXTROOT_SET_UP</constant> and
691 <constant>SD_LOGIND_KEXEC_REBOOT</constant> can be combined, with soft-reboot having precedence.
692 </para>
693
694 <para><function>SetRebootParameter()</function> sets a parameter for a subsequent reboot operation.
695 See the description of <command>reboot</command> in
696 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> and
697 <citerefentry project="man-pages"><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
698 for more information.</para>
699
700 <para><function>SetRebootToFirmwareSetup()</function>,
701 <function>SetRebootToBootLoaderMenu()</function>, and <function>SetRebootToBootLoaderEntry()</function>
702 configure the action to be taken from the boot loader after a reboot: respectively entering firmware
703 setup mode, the boot loader menu, or a specific boot loader entry. See
704 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> for the
705 corresponding command line interface.</para>
706
707 <para><function>CanPowerOff()</function>, <function>CanReboot()</function>, <function>CanHalt()</function>,
708 <function>CanSuspend()</function>, <function>CanHibernate()</function>, <function>CanHybridSleep()</function>,
709 <function>CanSuspendThenHibernate()</function>, <function>CanSleep()</function>,
710 <function>CanRebootParameter()</function>, <function>CanRebootToFirmwareSetup()</function>,
711 <function>CanRebootToBootLoaderMenu()</function>, and <function>CanRebootToBootLoaderEntry()</function>
712 test whether the system supports the respective operation and whether the calling user is allowed to
713 execute it. Returns one of <literal>na</literal>, <literal>yes</literal>, <literal>no</literal>,
714 <literal>challenge</literal>, <literal>inhibited</literal>, <literal>inhibitor-blocked</literal>,
715 and <literal>challenge-inhibitor-blocked</literal>. If <literal>na</literal> is returned, the operation
716 is not available because hardware, kernel, or drivers do not support it. If <literal>yes</literal> is
717 returned, the operation is supported and the user may execute the operation without further authentication.
718 If <literal>no</literal> is returned, the operation is available but the user is not allowed to execute
719 the operation. If <literal>challenge</literal> is returned, the operation is available but only after
720 authorization. If <literal>inhibited</literal> is returned, the operation is normally available without
721 authorization but is currently inhibited. The operation is available only if inhibitors are ignored and
722 after authorization. If <literal>inhibitor-blocked</literal> is returned, the operation is normally
723 available without authorization but is currently inhibited. While the inhibitor remains active, the user
724 is not allowed to execute the operation. <literal>challenge-inhibitor-blocked</literal> is similar:
725 the operation is normally available after authorization but a held inhibitor disallows the user from
726 executing the operation.</para>
727
728 <para><function>ScheduleShutdown()</function> schedules a shutdown operation <varname>type</varname> at
729 time <varname>usec</varname> in microseconds since the UNIX epoch. Alternatively, if
730 <varname>usec</varname> <literal>UINT64_MAX</literal> and a maintenance window is
731 configured, <filename>systemd-logind</filename> will use the next time of the maintenance window
732 instead. <varname>type</varname> can be one
733 of <literal>poweroff</literal>, <literal>dry-poweroff</literal>, <literal>reboot</literal>,
734 <literal>dry-reboot</literal>, <literal>halt</literal>, and <literal>dry-halt</literal>. (The
735 <literal>dry-</literal> variants do not actually execute the shutdown action.)
736 <function>CancelScheduledShutdown()</function> cancels a scheduled shutdown. The output parameter
737 <varname>cancelled</varname> is true if a shutdown operation was scheduled.</para>
738
739 <para><function>SetWallMessage()</function> sets the wall message (the message that will be sent out to
740 all terminals and stored in a
741 <citerefentry project="man-pages"><refentrytitle>utmp</refentrytitle><manvolnum>5</manvolnum></citerefentry> record) for a
742 subsequent scheduled shutdown operation. The parameter <varname>wall_message</varname> specifies the
743 shutdown reason (and may be empty) which will be included in the shutdown message. The parameter
744 <varname>enable</varname> specifies whether to print a wall message on shutdown.</para>
745
746 <para><function>Inhibit()</function> creates an inhibition lock. It takes four parameters:
747 <varname>what</varname>, <varname>who</varname>, <varname>why</varname>, and
748 <varname>mode</varname>. <varname>what</varname> is one or more of <literal>shutdown</literal>,
749 <literal>sleep</literal>, <literal>idle</literal>, <literal>handle-power-key</literal>,
750 <literal>handle-suspend-key</literal>, <literal>handle-hibernate-key</literal>,
751 <literal>handle-lid-switch</literal>, separated by colons, for inhibiting poweroff/reboot,
752 suspend/hibernate, the automatic idle logic, or hardware key handling. <varname>who</varname> should be
753 a short human-readable string identifying the application taking the lock. <varname>why</varname>
754 should be a short human-readable string identifying the reason why the lock is taken. Finally,
755 <varname>mode</varname> is either <literal>block</literal> or <literal>delay</literal> which encodes
756 whether the inhibit shall be consider mandatory or whether it should just delay the operation to a
757 certain maximum time, while the <literal>block-weak</literal> and variants will create an inhibitor
758 that is automatically ignored in some circumstances. The method returns a file descriptor. The lock is
759 released the moment this file descriptor and all its duplicates are closed. For more information on
760 the inhibition logic see <ulink url="https://systemd.io/INHIBITOR_LOCKS">Inhibitor Locks</ulink>.
761 </para>
762 </refsect2>
763
764 <refsect2>
765 <title>Signals</title>
766
767 <para>Whenever the inhibition state or idle hint changes, <function>PropertyChanged</function>
768 signals are sent out to clients which have subscribed.</para>
769
770 <para>The <function>SecureAttentionKey()</function> signal is sent when the user presses Ctrl+Alt+Shift+Esc to
771 request the login manager to display the greeter, for instance in the case of a deadlocked compositor.
772 </para>
773
774 <para>The <function>SessionNew()</function>, <function>SessionRemoved()</function>,
775 <function>UserNew()</function>, <function>UserRemoved()</function>, <function>SeatNew()</function>, and
776 <function>SeatRemoved()</function> signals are sent each time a session is created or removed, a user
777 logs in or out, or a seat is added or removed. They each contain the ID of the object plus the object
778 path.</para>
779
780 <para>The <function>PrepareForShutdown()</function>,
781 <function>PrepareForShutdownWithMetadata()</function>, and <function>PrepareForSleep()</function>
782 signals are sent right before (with the argument <literal>true</literal>) or after (with the argument
783 <literal>false</literal>) the system goes down for reboot/poweroff and suspend/hibernate,
784 respectively. This may be used by applications to save data on disk, release memory, or do other jobs
785 that should be done shortly before shutdown/sleep, in conjunction with delay inhibitor locks. After
786 completion of this work they should release their inhibition locks in order to not delay the operation
787 any further. For more information see
788 <ulink url="https://systemd.io/INHIBITOR_LOCKS">Inhibitor Locks</ulink>. The
789 <function>PrepareForShutdownWithMetadata()</function> signal additionally sends a list of key/value
790 pair metadata fields. Currently it sends a <varname>type</varname> string which defines the type of
791 shutdown. The type can be one of <literal>power-off</literal>, <literal>reboot</literal>,
792 <literal>halt</literal>, <literal>kexec</literal> or <literal>soft-reboot</literal>. This signal is
793 sent first, followed by <function>PrepareForShutdown()</function> (for backward compatibility).</para>
794 </refsect2>
795
796 <refsect2>
797 <title>Properties</title>
798
799 <para>Most properties simply reflect the configuration, see
800 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. This
801 includes: <varname>NAutoVTs</varname>, <varname>KillOnlyUsers</varname>,
802 <varname>KillExcludeUsers</varname>, <varname>KillUserProcesses</varname>, <varname>IdleAction</varname>,
803 <varname>InhibitDelayMaxUSec</varname>,
804 <varname>InhibitorsMax</varname>,
805 <varname>UserStopDelayUSec</varname>,
806 <varname>HandlePowerKey</varname>, <varname>HandleSuspendKey</varname>,
807 <varname>HandleHibernateKey</varname>, <varname>HandleLidSwitch</varname>,
808 <varname>HandleLidSwitchExternalPower</varname>, <varname>HandleLidSwitchDocked</varname>,
809 <varname>IdleActionUSec</varname>, <varname>HoldoffTimeoutUSec</varname>,
810 <varname>RemoveIPC</varname>, <varname>RuntimeDirectorySize</varname>,
811 <varname>RuntimeDirectoryInodesMax</varname>, <varname>InhibitorsMax</varname>, and
812 <varname>SessionsMax</varname>.
813 </para>
814
815 <para>The <varname>IdleHint</varname> property reflects the idle hint state of the system. If the
816 system is idle it might get into automatic suspend or shutdown depending on the configuration.</para>
817
818 <para><varname>IdleSinceHint</varname> and <varname>IdleSinceHintMonotonic</varname> encode the
819 timestamps of the last change of the idle hint boolean, in <constant>CLOCK_REALTIME</constant> and
820 <constant>CLOCK_MONOTONIC</constant> timestamps, respectively, in microseconds since the epoch.</para>
821
822 <para>The <varname>BlockInhibited</varname>, <varname>BlockWeakInhibited</varname>, and
823 <varname>DelayInhibited</varname> properties encode the currently active locks of the respective
824 modes. They are colon separated lists of <literal>shutdown</literal>, <literal>sleep</literal>, and
825 <literal>idle</literal> (see above).</para>
826
827 <para><varname>NCurrentSessions</varname> and <varname>NCurrentInhibitors</varname> contain the number
828 of currently registered sessions and inhibitors.</para>
829
830 <para>The <varname>BootLoaderEntries</varname> property contains a list of boot loader entries.
831 This includes boot loader entries defined in configuration and any additional loader entries
832 reported by the boot loader. See
833 <citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry>
834 for more information.</para>
835
836 <para>The <varname>PreparingForShutdown</varname> and <varname>PreparingForSleep</varname> boolean
837 properties are true during the interval between the two <function>PrepareForShutdown()</function> and
838 <function>PrepareForSleep()</function> signals respectively. The
839 <varname>PreparingForShutdownWithMetadata</varname> property provides a list of key/value pair
840 metadata fields. Currently it lists a <varname>preparing</varname> boolean that corresponds to the
841 <varname>PreparingForShutdown</varname> property, and, if a shutdown is being prepared, it will also
842 contain a <varname>type</varname> string which defines the type of shutdown. The type can be one of
843 <literal>power-off</literal>, <literal>reboot</literal>, <literal>halt</literal>,
844 <literal>kexec</literal> or <literal>soft-reboot</literal>. Note that these properties do not send out
845 <function>PropertyChanged</function> signals.</para>
846
847 <para>The <varname>RebootParameter</varname> property shows the value set with the
848 <function>SetRebootParameter()</function> method described above.</para>
849
850 <para><varname>ScheduledShutdown</varname> shows the value pair set with the
851 <function>ScheduleShutdown()</function> method described above.</para>
852
853 <para><varname>RebootToFirmwareSetup</varname>, <varname>RebootToBootLoaderMenu</varname>, and
854 <varname>RebootToBootLoaderEntry</varname> are true when the resprective post-reboot operation was
855 selected with <function>SetRebootToFirmwareSetup()</function>,
856 <function>SetRebootToBootLoaderMenu()</function>, or
857 <function>SetRebootToBootLoaderEntry()</function>.</para>
858
859 <para>The <varname>WallMessage</varname> and <varname>EnableWallMessages</varname> properties reflect the
860 shutdown reason and wall message enablement switch which can be set with the
861 <function>SetWallMessage()</function> method described above.</para>
862
863 <para><varname>Docked</varname> is true if the machine is connected to a dock.
864 <varname>LidClosed</varname> is true when the lid (of a laptop) is closed.
865 <varname>OnExternalPower</varname> is true when the machine is connected to an external power supply.
866 </para>
867 </refsect2>
868
869 <refsect2>
870 <title>Security</title>
871
872 <para>A number of operations are protected via the polkit privilege
873 system. <function>SetUserLinger()</function> requires the
874 <interfacename>org.freedesktop.login1.set-user-linger</interfacename>
875 privilege. <function>AttachDevice()</function> requires
876 <interfacename>org.freedesktop.login1.attach-device</interfacename> and
877 <function>FlushDevices()</function> requires
878 <interfacename>org.freedesktop.login1.flush-devices</interfacename>. <function>PowerOff()</function>,
879 <function>Reboot()</function>, <function>Halt()</function>, <function>Suspend()</function>,
880 <function>Hibernate()</function> require
881 <interfacename>org.freedesktop.login1.power-off</interfacename>,
882 <interfacename>org.freedesktop.login1.power-off-multiple-sessions</interfacename>,
883 <interfacename>org.freedesktop.login1.power-off-ignore-inhibit</interfacename>,
884 <interfacename>org.freedesktop.login1.reboot</interfacename>,
885 <interfacename>org.freedesktop.login1.reboot-multiple-sessions</interfacename>,
886 <interfacename>org.freedesktop.login1.reboot-ignore-inhibit</interfacename>,
887 <interfacename>org.freedesktop.login1.halt</interfacename>,
888 <interfacename>org.freedesktop.login1.halt-multiple-sessions</interfacename>,
889 <interfacename>org.freedesktop.login1.halt-ignore-inhibit</interfacename>,
890 <interfacename>org.freedesktop.login1.suspend</interfacename>,
891 <interfacename>org.freedesktop.login1.suspend-multiple-sessions</interfacename>,
892 <interfacename>org.freedesktop.login1.suspend-ignore-inhibit</interfacename>,
893 <interfacename>org.freedesktop.login1.hibernate</interfacename>,
894 <interfacename>org.freedesktop.login1.hibernate-multiple-sessions</interfacename>,
895 <interfacename>org.freedesktop.login1.hibernate-ignore-inhibit</interfacename>,
896 respectively depending on whether there are other sessions around or active inhibits are present.
897 <function>HybridSleep()</function> and <function>SuspendThenHibernate()</function>
898 use the same privileges as <function>Hibernate()</function>. <function>Sleep()</function> uses
899 the inhibits of the auto-selected sleep operation. <function>SetRebootParameter()</function> requires
900 <interfacename>org.freedesktop.login1.set-reboot-parameter</interfacename>.</para>
901
902 <para><function>SetRebootToFirmwareSetup()</function> requires
903 <interfacename>org.freedesktop.login1.set-reboot-to-firmware-setup</interfacename>.
904 <function>SetRebootToBootLoaderMenu()</function> requires
905 <interfacename>org.freedesktop.login1.set-reboot-to-boot-loader-menu</interfacename>.
906 <function>SetRebootToBootLoaderEntry()</function> requires
907 <interfacename>org.freedesktop.login1.set-reboot-to-boot-loader-entry</interfacename>.
908 </para>
909
910 <para><function>ScheduleShutdown()</function> and <function>CancelScheduledShutdown()</function> require
911 the same privileges (listed above) as the immediate poweroff/reboot/halt operations.</para>
912
913 <para><function>Inhibit()</function> is protected via one of
914 <interfacename>org.freedesktop.login1.inhibit-block-shutdown</interfacename>,
915 <interfacename>org.freedesktop.login1.inhibit-delay-shutdown</interfacename>,
916 <interfacename>org.freedesktop.login1.inhibit-block-sleep</interfacename>,
917 <interfacename>org.freedesktop.login1.inhibit-delay-sleep</interfacename>,
918 <interfacename>org.freedesktop.login1.inhibit-block-idle</interfacename>,
919 <interfacename>org.freedesktop.login1.inhibit-handle-power-key</interfacename>,
920 <interfacename>org.freedesktop.login1.inhibit-handle-suspend-key</interfacename>,
921 <interfacename>org.freedesktop.login1.inhibit-handle-hibernate-key</interfacename>,
922 <interfacename>org.freedesktop.login1.inhibit-handle-lid-switch</interfacename> depending on the lock
923 type and mode taken.</para>
924
925 <para>The <varname>interactive</varname> boolean parameters can be used to control whether polkit
926 should interactively ask the user for authentication credentials if required.</para>
927 </refsect2>
928 </refsect1>
929
930 <refsect1>
931 <title>Seat Objects</title>
932
933 <programlisting executable="systemd-logind" node="/org/freedesktop/login1/seat/seat0" interface="org.freedesktop.login1.Seat">
934 node /org/freedesktop/login1/seat/seat0 {
935 interface org.freedesktop.login1.Seat {
936 methods:
937 Terminate();
938 ActivateSession(in s session_id);
939 SwitchTo(in u vtnr);
940 SwitchToNext();
941 SwitchToPrevious();
942 properties:
943 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
944 readonly s Id = '...';
945 readonly (so) ActiveSession = ...;
946 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
947 readonly b CanTTY = ...;
948 readonly b CanGraphical = ...;
949 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
950 readonly a(so) Sessions = [...];
951 readonly b IdleHint = ...;
952 readonly t IdleSinceHint = ...;
953 readonly t IdleSinceHintMonotonic = ...;
954 };
955 interface org.freedesktop.DBus.Peer { ... };
956 interface org.freedesktop.DBus.Introspectable { ... };
957 interface org.freedesktop.DBus.Properties { ... };
958 };
959 </programlisting>
960
961 <!--Autogenerated cross-references for systemd.directives, do not edit-->
962
963 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.login1.Seat"/>
964
965 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.login1.Seat"/>
966
967 <variablelist class="dbus-method" generated="True" extra-ref="Terminate()"/>
968
969 <variablelist class="dbus-method" generated="True" extra-ref="ActivateSession()"/>
970
971 <variablelist class="dbus-method" generated="True" extra-ref="SwitchTo()"/>
972
973 <variablelist class="dbus-method" generated="True" extra-ref="SwitchToNext()"/>
974
975 <variablelist class="dbus-method" generated="True" extra-ref="SwitchToPrevious()"/>
976
977 <variablelist class="dbus-property" generated="True" extra-ref="Id"/>
978
979 <variablelist class="dbus-property" generated="True" extra-ref="ActiveSession"/>
980
981 <variablelist class="dbus-property" generated="True" extra-ref="CanTTY"/>
982
983 <variablelist class="dbus-property" generated="True" extra-ref="CanGraphical"/>
984
985 <variablelist class="dbus-property" generated="True" extra-ref="Sessions"/>
986
987 <variablelist class="dbus-property" generated="True" extra-ref="IdleHint"/>
988
989 <variablelist class="dbus-property" generated="True" extra-ref="IdleSinceHint"/>
990
991 <variablelist class="dbus-property" generated="True" extra-ref="IdleSinceHintMonotonic"/>
992
993 <!--End of Autogenerated section-->
994
995 <refsect2>
996 <title>Methods</title>
997
998 <para><function>Terminate()</function> and <function>ActivateSession()</function> work similarly to
999 <function>TerminateSeat()</function> and <function>ActivationSessionOnSeat()</function> on the Manager
1000 object.</para>
1001
1002 <para><function>SwitchTo()</function> switches to the session on the virtual terminal
1003 <varname>vtnr</varname>. <function>SwitchToNext()</function> and
1004 <function>SwitchToPrevious()</function> switch to, respectively, the next and previous sessions on the
1005 seat in the order of virtual terminals. If there is no active session, they switch to, respectively,
1006 the first and last session on the seat.</para>
1007 </refsect2>
1008
1009 <refsect2>
1010 <title>Signals</title>
1011
1012 <para>Whenever <function>ActiveSession</function>, <function>Sessions</function>,
1013 <function>CanGraphical</function>, <function>CanTTY</function>,
1014 or the idle state changes, <function>PropertyChanged</function> signals are sent out to clients which
1015 have subscribed.</para>
1016
1017 <para>Signals are only emitted on objects referencing a specific seat ID, not on the
1018 <literal>/org/freedesktop/login1/seat/self</literal> or
1019 <literal>/org/freedesktop/login1/seat/auto</literal> convenience objects, as they can only be
1020 dereferenced relative to a method caller.</para>
1021 </refsect2>
1022
1023 <refsect2>
1024 <title>Properties</title>
1025
1026 <para>The <varname>Id</varname> property encodes the ID of the seat.</para>
1027
1028 <para><varname>ActiveSession</varname> encodes the currently active session if there is one. It is a
1029 structure consisting of the session id and the object path.</para>
1030
1031 <para><varname>CanTTY</varname> encodes whether the session is suitable for text logins, and
1032 <varname>CanGraphical</varname> whether it is suitable for graphical sessions.</para>
1033
1034 <para>The <varname>Sessions</varname> property is an array of all current sessions of this seat, each
1035 encoded in a structure consisting of the ID and the object path.</para>
1036
1037 <para>The <varname>IdleHint</varname>, <varname>IdleSinceHint</varname>, and
1038 <varname>IdleSinceHintMonotonic</varname> properties encode the idle state, similarly to the ones
1039 exposed on the <interfacename>Manager</interfacename> object, but specific for this seat.</para>
1040 </refsect2>
1041 </refsect1>
1042
1043 <refsect1>
1044 <title>User Objects</title>
1045
1046 <programlisting executable="systemd-logind" node="/org/freedesktop/login1/user/_1000" interface="org.freedesktop.login1.User">
1047 node /org/freedesktop/login1/user/_1000 {
1048 interface org.freedesktop.login1.User {
1049 methods:
1050 Terminate();
1051 Kill(in i signal_number);
1052 properties:
1053 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1054 readonly u UID = ...;
1055 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1056 readonly u GID = ...;
1057 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1058 readonly s Name = '...';
1059 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1060 readonly t Timestamp = ...;
1061 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1062 readonly t TimestampMonotonic = ...;
1063 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1064 readonly s RuntimePath = '...';
1065 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1066 readonly s Service = '...';
1067 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1068 readonly s Slice = '...';
1069 readonly (so) Display = ...;
1070 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
1071 readonly s State = '...';
1072 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
1073 readonly a(so) Sessions = [...];
1074 readonly b IdleHint = ...;
1075 readonly t IdleSinceHint = ...;
1076 readonly t IdleSinceHintMonotonic = ...;
1077 readonly b Linger = ...;
1078 };
1079 interface org.freedesktop.DBus.Peer { ... };
1080 interface org.freedesktop.DBus.Introspectable { ... };
1081 interface org.freedesktop.DBus.Properties { ... };
1082 };
1083 </programlisting>
1084
1085 <!--Autogenerated cross-references for systemd.directives, do not edit-->
1086
1087 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.login1.User"/>
1088
1089 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.login1.User"/>
1090
1091 <variablelist class="dbus-method" generated="True" extra-ref="Terminate()"/>
1092
1093 <variablelist class="dbus-method" generated="True" extra-ref="Kill()"/>
1094
1095 <variablelist class="dbus-property" generated="True" extra-ref="UID"/>
1096
1097 <variablelist class="dbus-property" generated="True" extra-ref="GID"/>
1098
1099 <variablelist class="dbus-property" generated="True" extra-ref="Name"/>
1100
1101 <variablelist class="dbus-property" generated="True" extra-ref="Timestamp"/>
1102
1103 <variablelist class="dbus-property" generated="True" extra-ref="TimestampMonotonic"/>
1104
1105 <variablelist class="dbus-property" generated="True" extra-ref="RuntimePath"/>
1106
1107 <variablelist class="dbus-property" generated="True" extra-ref="Service"/>
1108
1109 <variablelist class="dbus-property" generated="True" extra-ref="Slice"/>
1110
1111 <variablelist class="dbus-property" generated="True" extra-ref="Display"/>
1112
1113 <variablelist class="dbus-property" generated="True" extra-ref="State"/>
1114
1115 <variablelist class="dbus-property" generated="True" extra-ref="Sessions"/>
1116
1117 <variablelist class="dbus-property" generated="True" extra-ref="IdleHint"/>
1118
1119 <variablelist class="dbus-property" generated="True" extra-ref="IdleSinceHint"/>
1120
1121 <variablelist class="dbus-property" generated="True" extra-ref="IdleSinceHintMonotonic"/>
1122
1123 <variablelist class="dbus-property" generated="True" extra-ref="Linger"/>
1124
1125 <!--End of Autogenerated section-->
1126
1127 <refsect2>
1128 <title>Methods</title>
1129
1130 <para><function>Terminate()</function> and <function>Kill()</function> work similarly to the
1131 <function>TerminateUser()</function> and <function>KillUser()</function> methods on the manager
1132 object.</para>
1133 </refsect2>
1134
1135 <refsect2>
1136 <title>Signals</title>
1137
1138 <para>Whenever <varname>Sessions</varname> or the idle state changes,
1139 <function>PropertyChanged</function> signals are sent out to clients which have subscribed.</para>
1140
1141 <para>Signals are only emitted on objects referencing a specific UID, not on the
1142 <literal>/org/freedesktop/login1/user/self</literal> convenience object, as <varname>self</varname>
1143 can only be dereferenced relative to a method caller.</para>
1144 </refsect2>
1145
1146 <refsect2>
1147 <title>Properties</title>
1148
1149 <para>The <varname>UID</varname> and <varname>GID</varname> properties encode the Unix UID and primary
1150 GID of the user.</para>
1151
1152 <para>The <varname>Name</varname> property encodes the user name.</para>
1153
1154 <para><varname>Timestamp</varname> and <varname>TimestampMonotonic</varname> encode the login time of
1155 the user in microseconds since the epoch, in the <constant>CLOCK_REALTIME</constant> and
1156 <constant>CLOCK_MONOTONIC</constant> clocks, respectively.</para>
1157
1158 <para><varname>RuntimePath</varname> encodes the runtime path of the user,
1159 i.e. <varname>$XDG_RUNTIME_DIR</varname>. For details see the
1160 <ulink url="https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html">
1161 XDG Basedir Specification
1162 </ulink>.</para>
1163
1164 <para><varname>Service</varname> contains the unit name of the user systemd service of this
1165 user. Each logged in user is assigned a user service that runs a user systemd instance. This is
1166 usually an instance of <filename>[email protected]</filename>.</para>
1167
1168 <para><varname>Slice</varname> contains the unit name of the user systemd slice of this user. Each
1169 logged in user gets a private slice.</para>
1170
1171 <para><varname>Display</varname> encodes which graphical session should be used as the primary UI display
1172 for the user. It is a structure encoding the session ID and the object path of the session to use.</para>
1173
1174 <para><varname>State</varname> encodes the user state and is one of <literal>offline</literal>,
1175 <literal>lingering</literal>, <literal>online</literal>, <literal>active</literal>, or
1176 <literal>closing</literal>. See
1177 <citerefentry><refentrytitle>sd_uid_get_state</refentrytitle><manvolnum>3</manvolnum></citerefentry>
1178 for more information about the states.</para>
1179
1180 <para><varname>Sessions</varname> is an array of structures encoding all current sessions of the
1181 user. Each structure consists of the ID and object path.</para>
1182
1183 <para>The <varname>IdleHint</varname>, <varname>IdleSinceHint</varname>, and
1184 <varname>IdleSinceHintMonotonic</varname> properties encode the idle hint state of the user, similarly
1185 to the <interfacename>Manager</interfacename>'s properties, but specific for this user.</para>
1186
1187 <para>The <varname>Linger</varname> property shows whether lingering is enabled for this user.</para>
1188 </refsect2>
1189 </refsect1>
1190
1191 <refsect1>
1192 <title>Session Objects</title>
1193
1194 <programlisting executable="systemd-logind" node="/org/freedesktop/login1/session/1" interface="org.freedesktop.login1.Session">
1195 node /org/freedesktop/login1/session/1 {
1196 interface org.freedesktop.login1.Session {
1197 methods:
1198 Terminate();
1199 Activate();
1200 Lock();
1201 Unlock();
1202 SetIdleHint(in b idle);
1203 SetLockedHint(in b locked);
1204 Kill(in s whom,
1205 in i signal_number);
1206 TakeControl(in b force);
1207 ReleaseControl();
1208 SetType(in s type);
1209 SetClass(in s class);
1210 SetDisplay(in s display);
1211 SetTTY(in h tty_fd);
1212 TakeDevice(in u major,
1213 in u minor,
1214 out h fd,
1215 out b inactive);
1216 ReleaseDevice(in u major,
1217 in u minor);
1218 PauseDeviceComplete(in u major,
1219 in u minor);
1220 SetBrightness(in s subsystem,
1221 in s name,
1222 in u brightness);
1223 signals:
1224 PauseDevice(u major,
1225 u minor,
1226 s type);
1227 ResumeDevice(u major,
1228 u minor,
1229 h fd);
1230 Lock();
1231 Unlock();
1232 properties:
1233 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1234 readonly s Id = '...';
1235 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1236 readonly (uo) User = ...;
1237 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1238 readonly s Name = '...';
1239 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1240 readonly t Timestamp = ...;
1241 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1242 readonly t TimestampMonotonic = ...;
1243 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1244 readonly u VTNr = ...;
1245 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1246 readonly (so) Seat = ...;
1247 readonly s TTY = '...';
1248 readonly s Display = '...';
1249 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1250 readonly b Remote = ...;
1251 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1252 readonly s RemoteHost = '...';
1253 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1254 readonly s RemoteUser = '...';
1255 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1256 readonly as ExtraDeviceAccess = ['...', ...];
1257 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1258 readonly s Service = '...';
1259 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1260 readonly s Desktop = '...';
1261 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1262 readonly s Scope = '...';
1263 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1264 readonly u Leader = ...;
1265 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1266 readonly t LeaderPIDFDId = ...;
1267 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1268 readonly u Audit = ...;
1269 readonly s Type = '...';
1270 readonly s Class = '...';
1271 readonly b Active = ...;
1272 readonly s State = '...';
1273 readonly b IdleHint = ...;
1274 readonly t IdleSinceHint = ...;
1275 readonly t IdleSinceHintMonotonic = ...;
1276 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1277 readonly b CanIdle = ...;
1278 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1279 readonly b CanLock = ...;
1280 readonly b LockedHint = ...;
1281 };
1282 interface org.freedesktop.DBus.Peer { ... };
1283 interface org.freedesktop.DBus.Introspectable { ... };
1284 interface org.freedesktop.DBus.Properties { ... };
1285 };
1286 </programlisting>
1287
1288 <!--Autogenerated cross-references for systemd.directives, do not edit-->
1289
1290 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.login1.Session"/>
1291
1292 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.login1.Session"/>
1293
1294 <variablelist class="dbus-method" generated="True" extra-ref="Terminate()"/>
1295
1296 <variablelist class="dbus-method" generated="True" extra-ref="Activate()"/>
1297
1298 <variablelist class="dbus-method" generated="True" extra-ref="Lock()"/>
1299
1300 <variablelist class="dbus-method" generated="True" extra-ref="Unlock()"/>
1301
1302 <variablelist class="dbus-method" generated="True" extra-ref="SetIdleHint()"/>
1303
1304 <variablelist class="dbus-method" generated="True" extra-ref="SetLockedHint()"/>
1305
1306 <variablelist class="dbus-method" generated="True" extra-ref="Kill()"/>
1307
1308 <variablelist class="dbus-method" generated="True" extra-ref="TakeControl()"/>
1309
1310 <variablelist class="dbus-method" generated="True" extra-ref="ReleaseControl()"/>
1311
1312 <variablelist class="dbus-method" generated="True" extra-ref="SetType()"/>
1313
1314 <variablelist class="dbus-method" generated="True" extra-ref="SetClass()"/>
1315
1316 <variablelist class="dbus-method" generated="True" extra-ref="SetDisplay()"/>
1317
1318 <variablelist class="dbus-method" generated="True" extra-ref="SetTTY()"/>
1319
1320 <variablelist class="dbus-method" generated="True" extra-ref="TakeDevice()"/>
1321
1322 <variablelist class="dbus-method" generated="True" extra-ref="ReleaseDevice()"/>
1323
1324 <variablelist class="dbus-method" generated="True" extra-ref="PauseDeviceComplete()"/>
1325
1326 <variablelist class="dbus-method" generated="True" extra-ref="SetBrightness()"/>
1327
1328 <variablelist class="dbus-signal" generated="True" extra-ref="PauseDevice()"/>
1329
1330 <variablelist class="dbus-signal" generated="True" extra-ref="ResumeDevice()"/>
1331
1332 <variablelist class="dbus-signal" generated="True" extra-ref="Lock()"/>
1333
1334 <variablelist class="dbus-signal" generated="True" extra-ref="Unlock()"/>
1335
1336 <variablelist class="dbus-property" generated="True" extra-ref="Id"/>
1337
1338 <variablelist class="dbus-property" generated="True" extra-ref="User"/>
1339
1340 <variablelist class="dbus-property" generated="True" extra-ref="Name"/>
1341
1342 <variablelist class="dbus-property" generated="True" extra-ref="Timestamp"/>
1343
1344 <variablelist class="dbus-property" generated="True" extra-ref="TimestampMonotonic"/>
1345
1346 <variablelist class="dbus-property" generated="True" extra-ref="VTNr"/>
1347
1348 <variablelist class="dbus-property" generated="True" extra-ref="Seat"/>
1349
1350 <variablelist class="dbus-property" generated="True" extra-ref="TTY"/>
1351
1352 <variablelist class="dbus-property" generated="True" extra-ref="Display"/>
1353
1354 <variablelist class="dbus-property" generated="True" extra-ref="Remote"/>
1355
1356 <variablelist class="dbus-property" generated="True" extra-ref="RemoteHost"/>
1357
1358 <variablelist class="dbus-property" generated="True" extra-ref="RemoteUser"/>
1359
1360 <variablelist class="dbus-property" generated="True" extra-ref="ExtraDeviceAccess"/>
1361
1362 <variablelist class="dbus-property" generated="True" extra-ref="Service"/>
1363
1364 <variablelist class="dbus-property" generated="True" extra-ref="Desktop"/>
1365
1366 <variablelist class="dbus-property" generated="True" extra-ref="Scope"/>
1367
1368 <variablelist class="dbus-property" generated="True" extra-ref="Leader"/>
1369
1370 <variablelist class="dbus-property" generated="True" extra-ref="LeaderPIDFDId"/>
1371
1372 <variablelist class="dbus-property" generated="True" extra-ref="Audit"/>
1373
1374 <variablelist class="dbus-property" generated="True" extra-ref="Type"/>
1375
1376 <variablelist class="dbus-property" generated="True" extra-ref="Class"/>
1377
1378 <variablelist class="dbus-property" generated="True" extra-ref="Active"/>
1379
1380 <variablelist class="dbus-property" generated="True" extra-ref="State"/>
1381
1382 <variablelist class="dbus-property" generated="True" extra-ref="IdleHint"/>
1383
1384 <variablelist class="dbus-property" generated="True" extra-ref="IdleSinceHint"/>
1385
1386 <variablelist class="dbus-property" generated="True" extra-ref="IdleSinceHintMonotonic"/>
1387
1388 <variablelist class="dbus-property" generated="True" extra-ref="CanIdle"/>
1389
1390 <variablelist class="dbus-property" generated="True" extra-ref="CanLock"/>
1391
1392 <variablelist class="dbus-property" generated="True" extra-ref="LockedHint"/>
1393
1394 <!--End of Autogenerated section-->
1395
1396 <refsect2>
1397 <title>Methods</title>
1398
1399 <para><function>Terminate()</function>, <function>Activate()</function>, <function>Lock()</function>,
1400 <function>Unlock()</function>, and <function>Kill()</function> work similarly to the respective calls on
1401 the <interfacename>Manager</interfacename> object.</para>
1402
1403 <para><function>SetIdleHint()</function> is called by the session object to update the idle state
1404 of the session whenever it changes.</para>
1405
1406 <para><function>TakeControl()</function> allows a process to take exclusive managed device
1407 access-control for that session. Only one D-Bus connection can be a controller for a given session at any
1408 time. If the <varname>force</varname> argument is set (root only), an existing controller is kicked
1409 out and replaced. Otherwise, this method fails if there is already a controller. Note that this method is
1410 limited to D-Bus users with the effective UID set to the user of the session or root.</para>
1411
1412 <para><function>ReleaseControl()</function> drops control of a given session. Closing the D-Bus
1413 connection implicitly releases control as well. See <function>TakeControl()</function> for more
1414 information. This method also releases all devices for which the controller requested ownership via
1415 <function>TakeDevice()</function>.</para>
1416
1417 <para><function>SetType()</function> allows the type of the session to be changed dynamically. It can
1418 only be called by session's current controller. If <function>TakeControl()</function> has not been
1419 called, this method will fail. In addition, the session type will be reset to its original value once
1420 control is released, either by calling <function>ReleaseControl()</function> or closing the D-Bus
1421 connection. This should help prevent a session from entering an inconsistent state, for example if the
1422 controller crashes. The only argument <varname>type</varname> is the new session type.</para>
1423
1424 <para><function>SetClass()</function> allows the caller to change the class of the session dynamically.
1425 It may only be called by session's owning user. Currently, this call may be exclusively used to change
1426 the class from <literal>user-incomplete</literal> to <literal>user</literal>. The call is synchronous,
1427 and will return only once the user's service manager has successfully been started, if necessary. The
1428 only argument <varname>type</varname> is the new session type.</para>
1429
1430 <para><function>SetDisplay()</function> allows the display name of the graphical session to be changed. This is
1431 useful if the display server is started as part of the session. It can only be called by session's current
1432 controller. If <function>TakeControl()</function> has not been called, this method will fail. The only argument
1433 <varname>display</varname> is the new display name.</para>
1434
1435 <para><function>SetTTY()</function> allows the device name of the session to be changed. This is
1436 useful if the tty device is only known after authentication. It can only be called by session's
1437 current controller. If <function>TakeControl()</function> has not been called, this method will fail.
1438 The only argument <varname>tty_fd</varname> is a file handle to the new tty device.</para>
1439
1440 <para><function>TakeDevice()</function> allows a session controller to get a file descriptor for a
1441 specific device. Pass in the major and minor numbers of the character device and
1442 <filename>systemd-logind</filename> will return a file descriptor for the device. Only a limited set of
1443 device-types is currently supported (but may be extended). <filename>systemd-logind</filename>
1444 automatically mutes the file descriptor if the session is inactive and resumes it once the session is
1445 activated again. This guarantees that a session can only access session devices if the session is
1446 active. Note that this revoke/resume mechanism is asynchronous and may happen at any given time. This
1447 only works on devices that are attached to the seat of the given session. A process is not required to
1448 have direct access to the device node. <filename>systemd-logind</filename> only requires you to be the
1449 active session controller (see <function>TakeControl()</function>). Also note that any device can only
1450 be requested once. As long as you do not release it, further <function>TakeDevice()</function> calls
1451 will fail.</para>
1452
1453 <para><function>ReleaseDevice()</function> releases a device again (see
1454 <function>TakeDevice()</function>). This is also implicitly done by
1455 <function>ReleaseControl()</function> or when closing the D-Bus connection.</para>
1456
1457 <para><function>PauseDeviceComplete()</function> allows a session controller to synchronously pause a
1458 device after receiving a <function>PauseDevice(<literal>pause</literal>)</function> signal. Forced
1459 signals (or after an internal timeout) are automatically completed by
1460 <filename>systemd-logind</filename> asynchronously.</para>
1461
1462 <para><function>SetLockedHint()</function> may be used to set the "locked hint" to
1463 <varname>locked</varname>, i.e. information whether the session is locked. This is intended to be used
1464 by the desktop environment to tell <command>systemd-logind</command> when the session is locked and
1465 unlocked.</para>
1466
1467 <para><function>SetBrightness()</function> may be used to set the display brightness. This is intended
1468 to be used by the desktop environment and allows unprivileged programs to access hardware settings in
1469 a controlled way. The <varname>subsystem</varname> parameter specifies a kernel subsystem, either
1470 <literal>backlight</literal> or <literal>leds</literal>. The <varname>name</varname> parameter
1471 specifies a device name under the specified subsystem. The <varname>brightness</varname> parameter
1472 specifies the brightness. The range is defined by individual drivers, see
1473 <filename>/sys/class/<varname>subsystem</varname>/<varname>name</varname>/max_brightness</filename>.
1474 </para>
1475 </refsect2>
1476
1477 <refsect2>
1478 <title>Signals</title>
1479
1480 <para>The active session controller exclusively gets <function>PauseDevice()</function> and
1481 <function>ResumeDevice()</function> events for any device it requested via
1482 <function>TakeDevice()</function>. They notify the controller whenever a device is paused or resumed. A
1483 device is never resumed if its session is inactive. Also note that <function>PauseDevice()</function>
1484 signals are sent before the <function>PropertyChanged</function> signal for the
1485 <function>Active</function> state. The inverse is true for <function>ResumeDevice()</function>. A device
1486 may remain paused for unknown reasons even though the <interfacename>Session</interfacename> is active.
1487 </para>
1488
1489 <para>A <function>PauseDevice()</function> signal carries the major and minor numbers and a string describing the
1490 type as arguments. <function>force</function> means the device was already paused by
1491 <filename>systemd-logind</filename> and the signal is only an asynchronous
1492 notification. <function>pause</function> means <filename>systemd-logind</filename> grants you a limited amount of time to pause the device. You must respond to this via
1493 <function>PauseDeviceComplete()</function>. This synchronous pausing mechanism is used for
1494 backwards-compatibility to VTs and <filename>systemd-logind</filename> is free to not make use of
1495 it. It is also free to send a forced <function>PauseDevice()</function> if you do not respond in a timely
1496 manner (or for any other reason). <function>gone</function> means the device was unplugged from the
1497 system and you will no longer get any notifications about it. There is no need to call
1498 <function>ReleaseDevice()</function>. You may call <function>TakeDevice()</function> again if a new
1499 device is assigned the major+minor combination.</para>
1500
1501 <para><function>ResumeDevice()</function> is sent whenever a session is active and a device is
1502 resumed. It carries the major/minor numbers as arguments and provides a new open file descriptor. You should
1503 switch to the new descriptor and close the old one. They are not guaranteed to have the same underlying
1504 open file descriptor in the kernel (except for a limited set of device types).</para>
1505
1506 <para>Whenever <function>Active</function> or the idle state changes,
1507 <function>PropertyChanged</function> signals are sent out to clients which have subscribed.</para>
1508
1509 <para><function>Lock()</function>/<function>Unlock()</function> is sent when the session is asked to be
1510 screen-locked/unlocked. A session manager of the session should listen to this signal and act
1511 accordingly. This signal is sent out as a result of the <function>Lock()</function> and
1512 <function>Unlock()</function> methods, respectively.</para>
1513
1514 <para>Signals are only emitted on objects referencing a specific session ID, not on the
1515 <literal>/org/freedesktop/login1/session/self</literal> or
1516 <literal>/org/freedesktop/login1/session/auto</literal> convenience objects, as they can only be
1517 dereferenced relative to a method caller.</para>
1518 </refsect2>
1519
1520 <refsect2>
1521 <title>Properties</title>
1522
1523 <para><varname>Id</varname> encodes the session ID.</para>
1524
1525 <para><varname>User</varname> encodes the user ID of the user this session belongs to. This is a
1526 structure consisting of the Unix UID and the object path.</para>
1527
1528 <para><varname>Name</varname> encodes the user name.</para>
1529
1530 <para><varname>Timestamp</varname> and <varname>TimestampMonotonic</varname> encode the microseconds
1531 since the epoch when the session was created, in <constant>CLOCK_REALTIME</constant> or
1532 <constant>CLOCK_MONOTONIC</constant>, respectively.</para>
1533
1534 <para><varname>VTNr</varname> encodes the virtual terminal number of the session if there is any, 0
1535 otherwise.</para>
1536
1537 <para><varname>Seat</varname> encodes the seat this session belongs to if there is any. This is a
1538 structure consisting of the ID and the seat object path.</para>
1539
1540 <para><varname>TTY</varname> encodes the kernel TTY path of the session if this is a text login. If not
1541 this is an empty string.</para>
1542
1543 <para><varname>Display</varname> encodes the X11 display name if this is a graphical login. If not,
1544 this is an empty string.</para>
1545
1546 <para><varname>Remote</varname> encodes whether the session is local or remote.</para>
1547
1548 <para><varname>RemoteHost</varname> and <varname>RemoteUser</varname> encode the remote host and user
1549 if this is a remote session, or an empty string otherwise.</para>
1550
1551 <para><varname>ExtraDeviceAccess</varname> encodes the set of additional hardware devices that the session
1552 is granted access to. For every <literal><replaceable>ID</replaceable></literal> in the list, the session
1553 is granted access to all devices tagged with <literal>xaccess-<replaceable>ID</replaceable></literal> in udev.</para>
1554
1555 <para><varname>Service</varname> encodes the PAM service name that registered the session.</para>
1556
1557 <para><varname>Desktop</varname> describes the desktop environment running in the session (if
1558 known).</para>
1559
1560 <para><varname>Scope</varname> contains the systemd scope unit name of this session.</para>
1561
1562 <para><varname>Leader</varname> encodes the PID of the process that registered the session.</para>
1563
1564 <para><varname>LeaderPIDFDId</varname> encodes the Linux pidfd inode ID of the process that registered
1565 the session.</para>
1566
1567 <para><varname>Audit</varname> encodes the Kernel Audit session ID of the session if auditing is
1568 available.</para>
1569
1570 <para><varname>Type</varname> encodes the session type. It's one of <literal>unspecified</literal> (for
1571 cron PAM sessions and suchlike), <literal>tty</literal> (for text logins), <literal>web</literal> (for
1572 web-based logins), or <literal>x11</literal>/<literal>mir</literal>/<literal>wayland</literal> (for
1573 graphical logins).</para>
1574
1575 <para><varname>Class</varname> encodes the session class. It's one of <literal>user</literal> (for
1576 normal user sessions), <literal>greeter</literal> (for display manager pseudo-sessions), or
1577 <literal>lock-screen</literal> (for display lock screens).</para>
1578
1579 <para><varname>Active</varname> is a boolean that is true if the session is active, i.e. currently in the
1580 foreground. This field is semi-redundant due to <varname>State</varname>.</para>
1581
1582 <para><varname>State</varname> encodes the session state and one of <literal>online</literal>,
1583 <literal>active</literal>, or <literal>closing</literal>. See
1584 <citerefentry><refentrytitle>sd_session_get_state</refentrytitle><manvolnum>3</manvolnum></citerefentry>
1585 for more information about the states.</para>
1586
1587 <para><varname>IdleHint</varname>, <varname>IdleSinceHint</varname>, and
1588 <varname>IdleSinceHintMonotonic</varname> encapsulate the idle hint state of this session, similarly to
1589 how the respective properties on the manager object do it for the whole system.</para>
1590
1591 <para><varname>LockedHint</varname> shows the locked hint state of this session, as set by the
1592 <function>SetLockedHint()</function> method described above.</para>
1593
1594 <para><varname>CanIdle</varname> indicates whether the session supports the idle hint
1595 concept. Similarly, <varname>CanLock</varname> indicates whether the session supports the screen lock
1596 concept.</para>
1597 </refsect2>
1598 </refsect1>
1599
1600 <refsect1>
1601 <title>Examples</title>
1602
1603 <example>
1604 <title>Introspect the logind manager on the bus</title>
1605
1606 <programlisting>$ gdbus introspect --system --dest org.freedesktop.login1 \
1607 --object-path /org/freedesktop/login1
1608 </programlisting>
1609
1610 <para>or</para>
1611
1612 <programlisting>$ busctl introspect org.freedesktop.login1 /org/freedesktop/login1
1613 </programlisting>
1614 </example>
1615
1616 <example>
1617 <title>Introspect the default seat on the bus</title>
1618
1619 <programlisting>$ gdbus introspect --system --dest org.freedesktop.login1 \
1620 --object-path /org/freedesktop/login1/seat/seat0
1621 </programlisting>
1622
1623 <para>or</para>
1624
1625 <programlisting>$ busctl introspect org.freedesktop.login1 /org/freedesktop/login1/seat/seat0
1626 </programlisting>
1627
1628 <para>Seat <literal>seat0</literal> is the default seat, so it'll be present unless local configuration
1629 is made to reassign all devices to a different seat. The list of seats and users can be acquired with
1630 <command>loginctl list-sessions</command>.</para>
1631 </example>
1632
1633 <example>
1634 <title>Introspect a single user on the bus</title>
1635
1636 <programlisting>$ gdbus introspect --system --dest org.freedesktop.login1 \
1637 --object-path /org/freedesktop/login1/user/_1000
1638 </programlisting>
1639
1640 <para>or</para>
1641
1642 <programlisting>$ busctl introspect org.freedesktop.login1 /org/freedesktop/login1/user/_1000
1643 </programlisting>
1644 </example>
1645
1646 <example>
1647 <title>Introspect <interfacename>org.freedesktop.login1.Session</interfacename> on the bus</title>
1648
1649 <programlisting>$ gdbus introspect --system --dest org.freedesktop.login1 \
1650 --object-path /org/freedesktop/login1/session/45
1651 </programlisting>
1652
1653 <para>or</para>
1654
1655 <programlisting>$ busctl introspect org.freedesktop.login1 /org/freedesktop/login1/session/45
1656 </programlisting>
1657 </example>
1658 </refsect1>
1659
1660 <xi:include href="org.freedesktop.locale1.xml" xpointer="versioning"/>
1661
1662 <refsect1>
1663 <title>History</title>
1664 <refsect2>
1665 <title>The Manager Object</title>
1666 <para><varname>HandlePowerKeyLongPress</varname>,
1667 <varname>HandleRebootKey</varname>,
1668 <varname>HandleRebootKeyLongPress</varname>,
1669 <varname>HandleSuspendKeyLongPress</varname>, and
1670 <varname>HandleHibernateKeyLongPress</varname> were added in version 251.</para>
1671 <para><varname>StopIdleSessionUSec</varname> was added in version 252.</para>
1672 <para><function>PrepareForShutdownWithMetadata()</function> and
1673 <function>CreateSessionWithPIDFD()</function> were added in version 255.</para>
1674 <para><function>Sleep()</function>,
1675 <function>CanSleep()</function>,
1676 <varname>SleepOperation</varname>, and
1677 <function>ListSessionsEx()</function> were added in version 256.</para>
1678 <para><varname>HandleSecureAttentionKey</varname>, <function>SecureAttentionKey()</function>,
1679 <varname>PreparingForShutdownWithMetadata</varname>, <varname>DesignatedMaintenanceTime</varname>,
1680 <varname>CanIdle</varname>, <varname>CanLock</varname>,
1681 and <varname>BlockWeakInhibited</varname> were added in version 257.</para>
1682 </refsect2>
1683 <refsect2>
1684 <title>Session Objects</title>
1685 <para><function>SetDisplay()</function> was added in version 252.</para>
1686 <para><function>SetTTY()</function> was added in version 254.</para>
1687 <para><function>SetClass()</function> was added in version 256.</para>
1688 <para><varname>LeaderPIDFDId</varname> was added in version 258.</para>
1689 <para><varname>ExtraDeviceAccess</varname> was added in version 260.</para>
1690 </refsect2>
1691 </refsect1>
1692
1693 <refsect1>
1694 <title>See Also</title>
1695 <para><simplelist type="inline">
1696 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
1697 <member><citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
1698 <member><citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
1699 </simplelist></para>
1700 </refsect1>
1701 </refentry>