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