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