]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/loginctl.xml
Merge pull request #8417 from brauner/2018-03-09/add_bind_mount_fallback_to_private_d...
[thirdparty/systemd.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 This file is part of systemd.
9
10 Copyright 2010 Lennart Poettering
11 -->
12
13 <refentry id="loginctl" conditional='ENABLE_LOGIND'
14 xmlns:xi="http://www.w3.org/2001/XInclude">
15
16 <refentryinfo>
17 <title>loginctl</title>
18 <productname>systemd</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 systemd 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 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
55 login manager
56 <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
57 </refsect1>
58
59 <refsect1>
60 <title>Options</title>
61
62 <para>The following options are understood:</para>
63
64 <variablelist>
65 <varlistentry>
66 <term><option>--no-ask-password</option></term>
67
68 <listitem><para>Do not query the user for authentication for
69 privileged operations.</para></listitem>
70 </varlistentry>
71
72 <varlistentry>
73 <term><option>-p</option></term>
74 <term><option>--property=</option></term>
75
76 <listitem><para>When showing session/user/seat properties,
77 limit display to certain properties as specified as argument.
78 If not specified, all set properties are shown. The argument
79 should be a property name, such as
80 <literal>Sessions</literal>. If specified more than once, all
81 properties with the specified names are
82 shown.</para></listitem>
83 </varlistentry>
84
85 <varlistentry>
86 <term><option>--value</option></term>
87
88 <listitem>
89 <para>When printing properties with <command>show</command>,
90 only print the value, and skip the property name and
91 <literal>=</literal>.</para>
92 </listitem>
93 </varlistentry>
94
95 <varlistentry>
96 <term><option>-a</option></term>
97 <term><option>--all</option></term>
98
99 <listitem><para>When showing session/user/seat properties,
100 show all properties regardless of whether they are set or
101 not.</para></listitem>
102 </varlistentry>
103
104 <varlistentry>
105 <term><option>-l</option></term>
106 <term><option>--full</option></term>
107
108 <listitem><para>Do not ellipsize process tree entries.</para>
109 </listitem>
110 </varlistentry>
111
112 <varlistentry>
113 <term><option>--kill-who=</option></term>
114
115 <listitem><para>When used with
116 <command>kill-session</command>, choose which processes to
117 kill. Must be one of <option>leader</option>, or
118 <option>all</option> to select whether to kill only the leader
119 process of the session or all processes of the session. If
120 omitted, defaults to <option>all</option>.</para></listitem>
121 </varlistentry>
122
123 <varlistentry>
124 <term><option>-s</option></term>
125 <term><option>--signal=</option></term>
126
127 <listitem><para>When used with <command>kill-session</command>
128 or <command>kill-user</command>, choose which signal to send
129 to selected processes. Must be one of the well known signal
130 specifiers, such as <constant>SIGTERM</constant>,
131 <constant>SIGINT</constant> or <constant>SIGSTOP</constant>.
132 If omitted, defaults to
133 <constant>SIGTERM</constant>.</para></listitem>
134 </varlistentry>
135
136 <varlistentry>
137 <term><option>-n</option></term>
138 <term><option>--lines=</option></term>
139
140 <listitem><para>When used with <command>user-status</command>
141 and <command>session-status</command>, controls the number of
142 journal lines to show, counting from the most recent ones.
143 Takes a positive integer argument. Defaults to 10.</para>
144 </listitem>
145 </varlistentry>
146
147 <varlistentry>
148 <term><option>-o</option></term>
149 <term><option>--output=</option></term>
150
151 <listitem><para>When used with <command>user-status</command>
152 and <command>session-status</command>, controls the formatting
153 of the journal entries that are shown. For the available
154 choices, see
155 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
156 Defaults to <literal>short</literal>.</para></listitem>
157 </varlistentry>
158
159 <xi:include href="user-system-options.xml" xpointer="host" />
160 <xi:include href="user-system-options.xml" xpointer="machine" />
161
162 <xi:include href="standard-options.xml" xpointer="no-pager" />
163 <xi:include href="standard-options.xml" xpointer="no-legend" />
164 <xi:include href="standard-options.xml" xpointer="help" />
165 <xi:include href="standard-options.xml" xpointer="version" />
166 </variablelist>
167 </refsect1>
168
169 <refsect1>
170 <title>Commands</title>
171
172 <para>The following commands are understood:</para>
173
174 <refsect2><title>Session Commands</title><variablelist>
175
176 <varlistentry>
177 <term><command>list-sessions</command></term>
178
179 <listitem><para>List current sessions.</para></listitem>
180 </varlistentry>
181
182 <varlistentry>
183 <term><command>session-status</command> <optional><replaceable>ID</replaceable></optional></term>
184
185 <listitem><para>Show terse runtime status information about
186 one or more sessions, followed by the most recent log data
187 from the journal. Takes one or more session identifiers as
188 parameters. If no session identifiers are passed, the status of
189 the caller's session is shown. This function is intended to
190 generate human-readable output. If you are looking for
191 computer-parsable output, use <command>show-session</command>
192 instead.</para></listitem>
193 </varlistentry>
194
195 <varlistentry>
196 <term><command>show-session</command> <optional><replaceable>ID</replaceable></optional></term>
197
198 <listitem><para>Show properties of one or more sessions or the
199 manager itself. If no argument is specified, properties of the
200 manager will be shown. If a session ID is specified,
201 properties of the session are shown. By default, empty
202 properties are suppressed. Use <option>--all</option> to show
203 those too. To select specific properties to show, use
204 <option>--property=</option>. This command is intended to be
205 used whenever computer-parsable output is required. Use
206 <command>session-status</command> if you are looking for
207 formatted human-readable output.</para></listitem>
208 </varlistentry>
209
210 <varlistentry>
211 <term><command>activate</command> <optional><replaceable>ID</replaceable></optional></term>
212
213 <listitem><para>Activate a session. This brings a session into
214 the foreground if another session is currently in the
215 foreground on the respective seat. Takes a session identifier
216 as argument. If no argument is specified, the session of the
217 caller is put into foreground.</para></listitem>
218 </varlistentry>
219
220 <varlistentry>
221 <term><command>lock-session</command> <optional><replaceable>ID</replaceable></optional></term>
222 <term><command>unlock-session</command> <optional><replaceable>ID</replaceable></optional></term>
223
224 <listitem><para>Activates/deactivates the screen lock on one
225 or more sessions, if the session supports it. Takes one or
226 more session identifiers as arguments. If no argument is
227 specified, the session of the caller is locked/unlocked.
228 </para></listitem>
229 </varlistentry>
230
231 <varlistentry>
232 <term><command>lock-sessions</command></term>
233 <term><command>unlock-sessions</command></term>
234
235 <listitem><para>Activates/deactivates the screen lock on all
236 current sessions supporting it. </para></listitem>
237 </varlistentry>
238
239 <varlistentry>
240 <term><command>terminate-session</command> <replaceable>ID</replaceable></term>
241
242 <listitem><para>Terminates a session. This kills all processes
243 of the session and deallocates all resources attached to the
244 session. </para></listitem>
245 </varlistentry>
246
247 <varlistentry>
248 <term><command>kill-session</command> <replaceable>ID</replaceable></term>
249
250 <listitem><para>Send a signal to one or more processes of the
251 session. Use <option>--kill-who=</option> to select which
252 process to kill. Use <option>--signal=</option> to select the
253 signal to send.</para></listitem>
254 </varlistentry>
255 </variablelist></refsect2>
256
257 <refsect2><title>User Commands</title><variablelist>
258 <varlistentry>
259 <term><command>list-users</command></term>
260
261 <listitem><para>List currently logged in users.
262 </para></listitem>
263 </varlistentry>
264
265 <varlistentry>
266 <term><command>user-status</command> <optional><replaceable>USER</replaceable></optional></term>
267
268 <listitem><para>Show terse runtime status information about
269 one or more logged in users, followed by the most recent log
270 data from the journal. Takes one or more user names or numeric
271 user IDs as parameters. If no parameters are passed, the status
272 is shown for the user of the session of the caller. This
273 function is intended to generate human-readable output. If you
274 are looking for computer-parsable output, use
275 <command>show-user</command> instead.</para></listitem>
276 </varlistentry>
277
278 <varlistentry>
279 <term><command>show-user</command> <optional><replaceable>USER</replaceable></optional></term>
280
281 <listitem><para>Show properties of one or more users or the
282 manager itself. If no argument is specified, properties of the
283 manager will be shown. If a user is specified, properties of
284 the user are shown. By default, empty properties are
285 suppressed. Use <option>--all</option> to show those too. To
286 select specific properties to show, use
287 <option>--property=</option>. This command is intended to be
288 used whenever computer-parsable output is required. Use
289 <command>user-status</command> if you are looking for
290 formatted human-readable output.</para></listitem>
291 </varlistentry>
292
293 <varlistentry>
294 <term><command>enable-linger</command> <optional><replaceable>USER</replaceable></optional></term>
295 <term><command>disable-linger</command> <optional><replaceable>USER</replaceable></optional></term>
296
297 <listitem><para>Enable/disable user lingering for one or more
298 users. If enabled for a specific user, a user manager is
299 spawned for the user at boot and kept around after logouts.
300 This allows users who are not logged in to run long-running
301 services. Takes one or more user names or numeric UIDs as
302 argument. If no argument is specified, enables/disables
303 lingering for the user of the session of the caller.</para>
304
305 <para>See also <varname>KillUserProcesses=</varname> setting in
306 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
307 </para></listitem>
308 </varlistentry>
309
310 <varlistentry>
311 <term><command>terminate-user</command> <replaceable>USER</replaceable></term>
312
313 <listitem><para>Terminates all sessions of a user. This kills
314 all processes of all sessions of the user and deallocates all
315 runtime resources attached to the user.</para></listitem>
316 </varlistentry>
317
318 <varlistentry>
319 <term><command>kill-user</command> <replaceable>USER</replaceable></term>
320
321 <listitem><para>Send a signal to all processes of a user. Use
322 <option>--signal=</option> to select the signal to send.
323 </para></listitem>
324 </varlistentry>
325 </variablelist></refsect2>
326
327 <refsect2><title>Seat Commands</title><variablelist>
328 <varlistentry>
329 <term><command>list-seats</command></term>
330
331 <listitem><para>List currently available seats on the local
332 system.</para></listitem>
333 </varlistentry>
334
335 <varlistentry>
336 <term><command>seat-status</command> <optional><replaceable>NAME</replaceable></optional></term>
337
338 <listitem><para>Show terse runtime status information about
339 one or more seats. Takes one or more seat names as parameters.
340 If no seat names are passed the status of the caller's
341 session's seat is shown. This function is intended to generate
342 human-readable output. If you are looking for
343 computer-parsable output, use <command>show-seat</command>
344 instead.</para></listitem>
345 </varlistentry>
346
347 <varlistentry>
348 <term><command>show-seat</command> <optional><replaceable>NAME</replaceable></optional></term>
349
350 <listitem><para>Show properties of one or more seats or the
351 manager itself. If no argument is specified, properties of the
352 manager will be shown. If a seat is specified, properties of
353 the seat are shown. By default, empty properties are
354 suppressed. Use <option>--all</option> to show those too. To
355 select specific properties to show, use
356 <option>--property=</option>. This command is intended to be
357 used whenever computer-parsable output is required. Use
358 <command>seat-status</command> if you are looking for
359 formatted human-readable output.</para></listitem>
360 </varlistentry>
361
362 <varlistentry>
363 <term><command>attach</command> <replaceable>NAME</replaceable> <replaceable>DEVICE</replaceable></term>
364
365 <listitem><para>Persistently attach one or more devices to a
366 seat. The devices should be specified via device paths in the
367 <filename>/sys</filename> file system. To create a new seat,
368 attach at least one graphics card to a previously unused seat
369 name. Seat names may consist only of a–z, A–Z, 09,
370 <literal>-</literal> and <literal>_</literal> and must be
371 prefixed with <literal>seat</literal>. To drop assignment of a
372 device to a specific seat, just reassign it to a different
373 seat, or use <command>flush-devices</command>.
374 </para></listitem>
375 </varlistentry>
376
377 <varlistentry>
378 <term><command>flush-devices</command></term>
379
380 <listitem><para>Removes all device assignments previously
381 created with <command>attach</command>. After this call, only
382 automatically generated seats will remain, and all seat
383 hardware is assigned to them.</para></listitem>
384 </varlistentry>
385
386 <varlistentry>
387 <term><command>terminate-seat</command> <replaceable>NAME</replaceable></term>
388
389 <listitem><para>Terminates all sessions on a seat. This kills
390 all processes of all sessions on the seat and deallocates all
391 runtime resources attached to them.</para></listitem>
392 </varlistentry>
393 </variablelist></refsect2>
394
395 </refsect1>
396
397 <refsect1>
398 <title>Exit status</title>
399
400 <para>On success, 0 is returned, a non-zero failure code
401 otherwise.</para>
402 </refsect1>
403
404 <refsect1>
405 <title>Examples</title>
406
407 <example>
408 <title>Querying user status</title>
409
410 <programlisting>$ loginctl user-status
411 fatima (1005)
412 Since: Sat 2016-04-09 14:23:31 EDT; 54min ago
413 State: active
414 Sessions: 5 *3
415 Unit: user-1005.slice
416 ├─user@1005.service
417
418 ├─session-3.scope
419
420 └─session-5.scope
421 ├─3473 login -- fatima
422 └─3515 -zsh
423
424 Apr 09 14:40:30 laptop login[2325]: pam_unix(login:session):
425 session opened for user fatima by LOGIN(uid=0)
426 Apr 09 14:40:30 laptop login[2325]: LOGIN ON tty3 BY fatima
427 </programlisting>
428
429 <para>There are two sessions, 3 and 5. Session 3 is a graphical session,
430 marked with a star. The tree of processing including the two corresponding
431 scope units and the user manager unit are shown.</para>
432 </example>
433 </refsect1>
434
435 <xi:include href="less-variables.xml" />
436
437 <refsect1>
438 <title>See Also</title>
439 <para>
440 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
441 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
442 <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
443 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
444 </para>
445 </refsect1>
446
447 </refentry>