chiark / gitweb /
man: drop unused <authorgroup> tags from man sources
[elogind.git] / man / loginctl.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6   SPDX-License-Identifier: LGPL-2.1+
7 -->
8
9 <!-- 0 /// elogind does not need to activate loginctl in configure
10 <refentry id="loginctl" conditional='ENABLE_LOGIND'
11     xmlns:xi="http://www.w3.org/2001/XInclude">
12 else -->
13 <refentry id="loginctl" xmlns:xi="http://www.w3.org/2001/XInclude">
14 <!-- // 0 -->
15
16   <refentryinfo>
17     <title>loginctl</title>
18     <productname>elogind</productname>
19   </refentryinfo>
20
21   <refmeta>
22     <refentrytitle>loginctl</refentrytitle>
23     <manvolnum>1</manvolnum>
24   </refmeta>
25
26   <refnamediv>
27     <refname>loginctl</refname>
28     <refpurpose>Control the elogind login manager</refpurpose>
29   </refnamediv>
30
31   <refsynopsisdiv>
32     <cmdsynopsis>
33       <command>loginctl</command>
34       <arg choice="opt" rep="repeat">OPTIONS</arg>
35       <arg choice="req">COMMAND</arg>
36       <arg choice="opt" rep="repeat">NAME</arg>
37     </cmdsynopsis>
38   </refsynopsisdiv>
39
40   <refsect1>
41     <title>Description</title>
42
43     <para><command>loginctl</command> may be used to introspect and
44     control the state of the
45     <!-- 0 /// elogind has no services and is in section 8
46     <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
47     login manager
48     <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
49     --><!-- else -->
50     <citerefentry><refentrytitle>elogind</refentrytitle><manvolnum>8</manvolnum></citerefentry>
51     login manager</para>
52     <!-- // 0 -->
53   </refsect1>
54
55   <refsect1>
56     <title>Options</title>
57
58     <para>The following options are understood:</para>
59
60     <variablelist>
61       <varlistentry>
62         <term><option>--no-ask-password</option></term>
63
64         <listitem><para>Do not query the user for authentication for
65         privileged operations.</para></listitem>
66       </varlistentry>
67
68       <varlistentry>
69         <term><option>-p</option></term>
70         <term><option>--property=</option></term>
71
72         <listitem><para>When showing session/user/seat properties,
73         limit display to certain properties as specified as argument.
74         If not specified, all set properties are shown. The argument
75         should be a property name, such as
76         <literal>Sessions</literal>. If specified more than once, all
77         properties with the specified names are
78         shown.</para></listitem>
79       </varlistentry>
80
81       <varlistentry>
82         <term><option>--value</option></term>
83
84         <listitem><para>When showing session/user/seat properties,
85         only print the value, and skip the property name and
86         <literal>=</literal>.</para></listitem>
87       </varlistentry>
88
89       <varlistentry>
90         <term><option>-a</option></term>
91         <term><option>--all</option></term>
92
93         <listitem><para>When showing session/user/seat properties,
94         show all properties regardless of whether they are set or
95         not.</para></listitem>
96       </varlistentry>
97
98       <varlistentry>
99         <term><option>-l</option></term>
100         <term><option>--full</option></term>
101
102         <listitem><para>Do not ellipsize process tree entries.</para>
103         </listitem>
104       </varlistentry>
105
106       <varlistentry>
107         <term><option>--kill-who=</option></term>
108
109         <listitem><para>When used with
110         <command>kill-session</command>, choose which processes to
111         kill. Must be one of <option>leader</option>, or
112         <option>all</option> to select whether to kill only the leader
113         process of the session or all processes of the session. If
114         omitted, defaults to <option>all</option>.</para></listitem>
115       </varlistentry>
116
117       <varlistentry>
118         <term><option>-s</option></term>
119         <term><option>--signal=</option></term>
120
121         <listitem><para>When used with <command>kill-session</command>
122         or <command>kill-user</command>, choose which signal to send
123         to selected processes. Must be one of the well known signal
124         specifiers, such as <constant>SIGTERM</constant>,
125         <constant>SIGINT</constant> or <constant>SIGSTOP</constant>.
126         If omitted, defaults to
127         <constant>SIGTERM</constant>.</para></listitem>
128       </varlistentry>
129
130       <!-- 0 /// elogind does not support systemd-journal
131       <varlistentry>
132         <term><option>-n</option></term>
133         <term><option>&#x2D;&#x2D;lines=</option></term>
134
135         <listitem><para>When used with <command>user-status</command>
136         and <command>session-status</command>, controls the number of
137         journal lines to show, counting from the most recent ones.
138         Takes a positive integer argument. Defaults to 10.</para>
139         </listitem>
140       </varlistentry>
141
142       <varlistentry>
143         <term><option>-o</option></term>
144         <term><option>&#x2D;&#x2D;output=</option></term>
145
146         <listitem><para>When used with <command>user-status</command>
147         and <command>session-status</command>, controls the formatting
148         of the journal entries that are shown. For the available
149         choices, see
150         <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
151         Defaults to <literal>short</literal>.</para></listitem>
152       </varlistentry>
153       // 0 -->
154
155       <xi:include href="user-system-options.xml" xpointer="host" />
156       <xi:include href="user-system-options.xml" xpointer="machine" />
157
158       <xi:include href="standard-options.xml" xpointer="no-pager" />
159       <xi:include href="standard-options.xml" xpointer="no-legend" />
160       <xi:include href="standard-options.xml" xpointer="help" />
161       <xi:include href="standard-options.xml" xpointer="version" />
162     </variablelist>
163   </refsect1>
164
165   <refsect1>
166     <title>Commands</title>
167
168     <para>The following commands are understood:</para>
169
170     <refsect2><title>Session Commands</title><variablelist>
171
172       <varlistentry>
173         <term><command>list-sessions</command></term>
174
175         <listitem><para>List current sessions.</para></listitem>
176       </varlistentry>
177
178       <varlistentry>
179         <term><command>session-status</command> <optional><replaceable>ID</replaceable>…</optional></term>
180
181         <listitem><para>Show terse runtime status information about
182         one or more sessions, followed by the most recent log data
183         from the journal. Takes one or more session identifiers as
184         parameters. If no session identifiers are passed, the status of
185         the caller's session is shown. This function is intended to
186         generate human-readable output. If you are looking for
187         computer-parsable output, use <command>show-session</command>
188         instead.</para></listitem>
189       </varlistentry>
190
191       <varlistentry>
192         <term><command>show-session</command> <optional><replaceable>ID</replaceable>…</optional></term>
193
194         <listitem><para>Show properties of one or more sessions or the
195         manager itself. If no argument is specified, properties of the
196         manager will be shown. If a session ID is specified,
197         properties of the session are shown. By default, empty
198         properties are suppressed. Use <option>--all</option> to show
199         those too. To select specific properties to show, use
200         <option>--property=</option>. This command is intended to be
201         used whenever computer-parsable output is required. Use
202         <command>session-status</command> if you are looking for
203         formatted human-readable output.</para></listitem>
204       </varlistentry>
205
206       <varlistentry>
207         <term><command>activate</command> <optional><replaceable>ID</replaceable></optional></term>
208
209         <listitem><para>Activate a session. This brings a session into
210         the foreground if another session is currently in the
211         foreground on the respective seat. Takes a session identifier
212         as argument. If no argument is specified, the session of the
213         caller is put into foreground.</para></listitem>
214       </varlistentry>
215
216       <varlistentry>
217         <term><command>lock-session</command> <optional><replaceable>ID</replaceable>…</optional></term>
218         <term><command>unlock-session</command> <optional><replaceable>ID</replaceable>…</optional></term>
219
220         <listitem><para>Activates/deactivates the screen lock on one
221         or more sessions, if the session supports it. Takes one or
222         more session identifiers as arguments. If no argument is
223         specified, the session of the caller is locked/unlocked.
224         </para></listitem>
225       </varlistentry>
226
227       <varlistentry>
228         <term><command>lock-sessions</command></term>
229         <term><command>unlock-sessions</command></term>
230
231         <listitem><para>Activates/deactivates the screen lock on all
232         current sessions supporting it. </para></listitem>
233       </varlistentry>
234
235       <varlistentry>
236         <term><command>terminate-session</command> <replaceable>ID</replaceable>…</term>
237
238         <listitem><para>Terminates a session. This kills all processes
239         of the session and deallocates all resources attached to the
240         session. </para></listitem>
241       </varlistentry>
242
243       <varlistentry>
244         <term><command>kill-session</command> <replaceable>ID</replaceable>…</term>
245
246         <listitem><para>Send a signal to one or more processes of the
247         session. Use <option>--kill-who=</option> to select which
248         process to kill. Use <option>--signal=</option> to select the
249         signal to send.</para></listitem>
250       </varlistentry>
251     </variablelist></refsect2>
252
253     <refsect2><title>User Commands</title><variablelist>
254       <varlistentry>
255         <term><command>list-users</command></term>
256
257         <listitem><para>List currently logged in users.
258         </para></listitem>
259       </varlistentry>
260
261       <varlistentry>
262         <term><command>user-status</command> <optional><replaceable>USER</replaceable>…</optional></term>
263
264         <listitem><para>Show terse runtime status information about
265         one or more logged in users, followed by the most recent log
266         data from the journal. Takes one or more user names or numeric
267         user IDs as parameters. If no parameters are passed, the status
268         is shown for the user of the session of the caller. This
269         function is intended to generate human-readable output. If you
270         are looking for computer-parsable output, use
271         <command>show-user</command> instead.</para></listitem>
272       </varlistentry>
273
274       <varlistentry>
275         <term><command>show-user</command> <optional><replaceable>USER</replaceable>…</optional></term>
276
277         <listitem><para>Show properties of one or more users or the
278         manager itself. If no argument is specified, properties of the
279         manager will be shown. If a user is specified, properties of
280         the user are shown. By default, empty properties are
281         suppressed. Use <option>--all</option> to show those too. To
282         select specific properties to show, use
283         <option>--property=</option>. This command is intended to be
284         used whenever computer-parsable output is required. Use
285         <command>user-status</command> if you are looking for
286         formatted human-readable output.</para></listitem>
287       </varlistentry>
288
289       <!-- 0 /// elogind does not spawn a user manager. Mask until lingeringin elogind is clarified.
290       <varlistentry>
291         <term><command>enable-linger</command> <optional><replaceable>USER</replaceable>…</optional></term>
292         <term><command>disable-linger</command> <optional><replaceable>USER</replaceable>…</optional></term>
293
294         <listitem><para>Enable/disable user lingering for one or more
295         users. If enabled for a specific user, a user manager is
296         spawned for the user at boot and kept around after logouts.
297         This allows users who are not logged in to run long-running
298         services. Takes one or more user names or numeric UIDs as
299         argument. If no argument is specified, enables/disables
300         lingering for the user of the session of the caller.</para>
301
302         <para>See also <varname>KillUserProcesses=</varname> setting in
303         <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
304         </para></listitem>
305       </varlistentry>
306       // 0 -->
307
308       <varlistentry>
309         <term><command>terminate-user</command> <replaceable>USER</replaceable>…</term>
310
311         <listitem><para>Terminates all sessions of a user. This kills
312         all processes of all sessions of the user and deallocates all
313         runtime resources attached to the user.</para></listitem>
314       </varlistentry>
315
316       <varlistentry>
317         <term><command>kill-user</command> <replaceable>USER</replaceable>…</term>
318
319         <listitem><para>Send a signal to all processes of a user. Use
320         <option>--signal=</option> to select the signal to send.
321         </para></listitem>
322       </varlistentry>
323     </variablelist></refsect2>
324
325     <refsect2><title>Seat Commands</title><variablelist>
326       <varlistentry>
327         <term><command>list-seats</command></term>
328
329         <listitem><para>List currently available seats on the local
330         system.</para></listitem>
331       </varlistentry>
332
333       <varlistentry>
334         <term><command>seat-status</command> <optional><replaceable>NAME</replaceable>…</optional></term>
335
336         <listitem><para>Show terse runtime status information about
337         one or more seats. Takes one or more seat names as parameters.
338         If no seat names are passed the status of the caller's
339         session's seat is shown. This function is intended to generate
340         human-readable output. If you are looking for
341         computer-parsable output, use <command>show-seat</command>
342         instead.</para></listitem>
343       </varlistentry>
344
345       <varlistentry>
346         <term><command>show-seat</command> <optional><replaceable>NAME</replaceable>…</optional></term>
347
348         <listitem><para>Show properties of one or more seats or the
349         manager itself. If no argument is specified, properties of the
350         manager will be shown. If a seat is specified, properties of
351         the seat are shown. By default, empty properties are
352         suppressed. Use <option>--all</option> to show those too. To
353         select specific properties to show, use
354         <option>--property=</option>. This command is intended to be
355         used whenever computer-parsable output is required. Use
356         <command>seat-status</command> if you are looking for
357         formatted human-readable output.</para></listitem>
358       </varlistentry>
359
360       <varlistentry>
361         <term><command>attach</command> <replaceable>NAME</replaceable> <replaceable>DEVICE</replaceable>…</term>
362
363         <listitem><para>Persistently attach one or more devices to a
364         seat. The devices should be specified via device paths in the
365         <filename>/sys</filename> file system. To create a new seat,
366         attach at least one graphics card to a previously unused seat
367         name. Seat names may consist only of a–z, A–Z, 0–9,
368         <literal>-</literal> and <literal>_</literal> and must be
369         prefixed with <literal>seat</literal>. To drop assignment of a
370         device to a specific seat, just reassign it to a different
371         seat, or use <command>flush-devices</command>.
372         </para></listitem>
373       </varlistentry>
374
375       <varlistentry>
376         <term><command>flush-devices</command></term>
377
378         <listitem><para>Removes all device assignments previously
379         created with <command>attach</command>. After this call, only
380         automatically generated seats will remain, and all seat
381         hardware is assigned to them.</para></listitem>
382       </varlistentry>
383
384       <varlistentry>
385         <term><command>terminate-seat</command> <replaceable>NAME</replaceable>…</term>
386
387         <listitem><para>Terminates all sessions on a seat. This kills
388         all processes of all sessions on the seat and deallocates all
389         runtime resources attached to them.</para></listitem>
390       </varlistentry>
391     </variablelist></refsect2>
392
393     <!-- 1 /// elogind additionally supports a few systemctl commands. -->
394     <refsect2><title>System Commands</title><variablelist>
395       <varlistentry>
396         <term><command>poweroff</command></term>
397
398         <listitem>
399           <para>Print a wall message to all users, shut down and
400             power-off the system.</para>
401         </listitem>
402       </varlistentry>
403       <varlistentry>
404         <term><command>reboot <optional><replaceable>arg</replaceable></optional></command></term>
405
406         <listitem>
407           <para>Print a wall message to all users, shut down and
408             reboot the system.</para>
409
410           <para>If the optional argument
411           <replaceable>arg</replaceable> is given, it will be passed
412           as the optional argument to the
413           <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
414           system call. The value is architecture and firmware
415           specific. As an example, <literal>recovery</literal> might
416           be used to trigger system recovery, and
417           <literal>fota</literal> might be used to trigger a
418           <quote>firmware over the air</quote> update.</para>
419         </listitem>
420       </varlistentry>
421
422       <varlistentry>
423         <term><command>suspend</command></term>
424
425         <listitem>
426           <para>Suspend the system.
427           </para>
428         </listitem>
429       </varlistentry>
430
431       <varlistentry>
432         <term><command>hibernate</command></term>
433
434         <listitem>
435           <para>Hibernate the system.
436           </para>
437         </listitem>
438       </varlistentry>
439
440       <varlistentry>
441         <term><command>hybrid-sleep</command></term>
442
443         <listitem>
444           <para>Hibernate and suspend the system.</para>
445         </listitem>
446       </varlistentry>
447     </variablelist></refsect2>
448     <!-- // 1 -->
449   </refsect1>
450
451   <refsect1>
452     <title>Exit status</title>
453
454     <para>On success, 0 is returned, a non-zero failure code
455     otherwise.</para>
456   </refsect1>
457
458   <refsect1>
459     <title>Examples</title>
460
461     <example>
462       <title>Querying user status</title>
463
464       <!-- 0 /// With elogind no Unit and jurnald output is generated
465       <programlisting>$ loginctl user-status
466 fatima (1005)
467            Since: Sat 2016-04-09 14:23:31 EDT; 54min ago
468            State: active
469         Sessions: 5 *3
470             Unit: user-1005.slice
471                   ├─user@1005.service
472                     …
473                   ├─session-3.scope
474                     …
475                   └─session-5.scope
476                     ├─3473 login &#x2D;&#x2D; fatima
477                     └─3515 -zsh
478
479 Apr 09 14:40:30 laptop login[2325]: pam_unix(login:session):
480                        session opened for user fatima by LOGIN(uid=0)
481 Apr 09 14:40:30 laptop login[2325]: LOGIN ON tty3 BY fatima
482 </programlisting>
483       --><!-- else -->
484       <programlisting>$ loginctl user-status
485 fatima (1005)
486            Since: Sat 2016-04-09 14:23:31 EDT; 54min ago
487            State: active
488         Sessions: 5 *3
489             Unit: user-1005.slice
490 </programlisting>
491       <!-- // 0 -->
492
493       <para>There are two sessions, 3 and 5. Session 3 is a graphical session,
494       marked with a star. The tree of processing including the two corresponding
495       scope units and the user manager unit are shown.</para>
496     </example>
497   </refsect1>
498
499   <xi:include href="less-variables.xml" />
500
501   <refsect1>
502     <title>See Also</title>
503     <para>
504       <!-- 0 /// elogind is in section 8
505       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
506       <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
507       <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
508       --><!-- else -->
509       <citerefentry><refentrytitle>elogind</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
510       <!-- // 0 -->
511       <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
512     </para>
513   </refsect1>
514
515 </refentry>