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