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