chiark / gitweb /
loginctl: show the 10 most recent log user/session log lines in "loginctl user-status...
[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 systemd.
7
8   Copyright 2010 Lennart Poettering
9
10   systemd 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   systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="loginctl" conditional='ENABLE_LOGIND'
25           xmlns:xi="http://www.w3.org/2001/XInclude">
26
27         <refentryinfo>
28                 <title>loginctl</title>
29                 <productname>systemd</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 systemd 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
64                 introspect and control the state of the
65                 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
66                 login manager <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</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-legend</option></term>
77
78                                 <listitem>
79                                         <para>Do not print the legend,
80                                         i.e. the column headers and
81                                         the footer.</para>
82                                 </listitem>
83                         </varlistentry>
84
85                         <varlistentry>
86                                 <term><option>--no-ask-password</option></term>
87
88                                 <listitem><para>Do not query the user
89                                 for authentication for privileged
90                                 operations.</para></listitem>
91                         </varlistentry>
92
93                         <varlistentry>
94                                 <term><option>-p</option></term>
95                                 <term><option>--property=</option></term>
96
97                                 <listitem><para>When showing
98                                 session/user/seat properties, limit
99                                 display to certain properties as
100                                 specified as argument. If not
101                                 specified, all set properties are
102                                 shown. The argument should be a
103                                 property name, such as
104                                 <literal>Sessions</literal>. If
105                                 specified more than once, all
106                                 properties with the specified names
107                                 are shown.</para></listitem>
108                         </varlistentry>
109
110                         <varlistentry>
111                                 <term><option>-a</option></term>
112                                 <term><option>--all</option></term>
113
114                                 <listitem><para>When showing
115                                 session/user/seat properties, show all
116                                 properties regardless of whether they are
117                                 set or not.</para></listitem>
118                         </varlistentry>
119
120                         <varlistentry>
121                                 <term><option>-l</option></term>
122                                 <term><option>--full</option></term>
123
124                                 <listitem><para>Do not ellipsize
125                                 process tree entries.</para>
126                                 </listitem>
127                         </varlistentry>
128
129                         <varlistentry>
130                                 <term><option>--kill-who=</option></term>
131
132                                 <listitem><para>When used with
133                                 <command>kill-session</command>,
134                                 choose which processes to kill. Must
135                                 be one of <option>leader</option>, or
136                                 <option>all</option> to select whether
137                                 to kill only the leader process of the
138                                 session or all processes of the
139                                 session. If omitted, defaults to
140                                 <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
148                                 <command>kill-session</command> or
149                                 <command>kill-user</command>, choose
150                                 which signal to send to selected
151                                 processes. Must be one of the well
152                                 known signal specifiers, such as
153                                 <constant>SIGTERM</constant>,
154                                 <constant>SIGINT</constant> or
155                                 <constant>SIGSTOP</constant>. If
156                                 omitted, defaults to
157                                 <constant>SIGTERM</constant>.</para></listitem>
158                         </varlistentry>
159
160                         <varlistentry>
161                                 <term><option>-n</option></term>
162                                 <term><option>--lines=</option></term>
163
164                                 <listitem><para>When used with
165                                 <command>user-status</command> and
166                                 <command>session-status</command>,
167                                 controls the number of journal lines
168                                 to show, counting from the most recent
169                                 ones. Takes a positive integer
170                                 argument. Defaults to 10.</para>
171                                 </listitem>
172                         </varlistentry>
173
174                         <varlistentry>
175                                 <term><option>-o</option></term>
176                                 <term><option>--output=</option></term>
177
178                                 <listitem><para>When used with
179                                 <command>user-status</command> and
180                                 <command>session-status</command>,
181                                 controls the formatting of the journal
182                                 entries that are shown. For the
183                                 available choices, see
184                                 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
185                                 Defaults to
186                                 <literal>short</literal>.</para></listitem>
187                         </varlistentry>
188
189                         <xi:include href="user-system-options.xml" xpointer="host" />
190                         <xi:include href="user-system-options.xml" xpointer="machine" />
191
192                         <xi:include href="standard-options.xml" xpointer="help" />
193                         <xi:include href="standard-options.xml" xpointer="version" />
194                         <xi:include href="standard-options.xml" xpointer="no-pager" />
195                 </variablelist>
196
197                 <para>The following commands are understood:</para>
198
199                 <variablelist>
200                         <varlistentry>
201                                 <term><command>list-sessions</command></term>
202
203                                 <listitem><para>List current sessions.</para></listitem>
204                         </varlistentry>
205
206                         <varlistentry>
207                                 <term><command>session-status</command> <replaceable>ID</replaceable>...</term>
208
209                                 <listitem><para>Show terse runtime
210                                 status information about one or more
211                                 sessions, followed by the most recent
212                                 log data from the journal. This
213                                 function is intended to generate
214                                 human-readable output. If you are
215                                 looking for computer-parsable output,
216                                 use <command>show-session</command>
217                                 instead.</para></listitem>
218                         </varlistentry>
219
220                         <varlistentry>
221                                 <term><command>show-session</command> <optional><replaceable>ID</replaceable>...</optional></term>
222
223                                 <listitem><para>Show properties of one
224                                 or more sessions or the manager
225                                 itself. If no argument is specified,
226                                 properties of the manager will be
227                                 shown. If a session ID is specified,
228                                 properties of the session are shown. By
229                                 default, empty properties are
230                                 suppressed. Use <option>--all</option>
231                                 to show those too. To select specific
232                                 properties to show, use
233                                 <option>--property=</option>. This
234                                 command is intended to be used
235                                 whenever computer-parsable output is
236                                 required. Use
237                                 <command>session-status</command> if
238                                 you are looking for formatted
239                                 human-readable
240                                 output.</para></listitem>
241                         </varlistentry>
242
243                         <varlistentry>
244                                 <term><command>activate</command> <replaceable>ID</replaceable>...</term>
245
246                                 <listitem><para>Activate one or more
247                                 sessions. This brings one or more
248                                 sessions into the foreground, if
249                                 another session is currently in the
250                                 foreground on the respective
251                                 seat.</para></listitem>
252                         </varlistentry>
253
254                         <varlistentry>
255                                 <term><command>lock-session</command> <replaceable>ID</replaceable>...</term>
256                                 <term><command>unlock-session</command> <replaceable>ID</replaceable>...</term>
257
258                                 <listitem><para>Activates/deactivates
259                                 the screen lock on one or more
260                                 sessions, if the session supports it.
261                                 </para></listitem>
262                         </varlistentry>
263
264                         <varlistentry>
265                                 <term><command>lock-sessions</command></term>
266                                 <term><command>unlock-sessions</command></term>
267
268                                 <listitem><para>Activates/deactivates
269                                 the screen lock on all current
270                                 sessions supporting it.
271                                 </para></listitem>
272                         </varlistentry>
273
274                         <varlistentry>
275                                 <term><command>terminate-session</command> <replaceable>ID</replaceable>...</term>
276
277                                 <listitem><para>Terminates a session.
278                                 This kills all processes of the
279                                 session and deallocates all resources
280                                 attached to the session.
281                                 </para></listitem>
282                         </varlistentry>
283
284                         <varlistentry>
285                                 <term><command>kill-session</command> <replaceable>ID</replaceable>...</term>
286
287                                 <listitem><para>Send a signal to one
288                                 or more processes of the session. Use
289                                 <option>--kill-who=</option> to select
290                                 which process to kill. Use
291                                 <option>--signal=</option> to select
292                                 the signal to send.</para></listitem>
293                         </varlistentry>
294
295                         <varlistentry>
296                                 <term><command>list-users</command></term>
297
298                                 <listitem><para>List currently logged
299                                 in users.</para></listitem>
300                         </varlistentry>
301
302                         <varlistentry>
303                                 <term><command>user-status</command> <replaceable>USER</replaceable>...</term>
304
305                                 <listitem><para>Show terse runtime
306                                 status information about one or more
307                                 logged in users, followed by the most
308                                 recent log data from the journal. This
309                                 function is intended to generate
310                                 human-readable output. If you are
311                                 looking for computer-parsable output,
312                                 use <command>show-user</command>
313                                 instead.  Users may be specified by
314                                 their usernames or numeric user IDs.
315                                 </para></listitem>
316                         </varlistentry>
317
318                         <varlistentry>
319                                 <term><command>show-user</command> <optional><replaceable>USER</replaceable>...</optional></term>
320
321                                 <listitem><para>Show properties of one
322                                 or more users or the manager
323                                 itself. If no argument is specified,
324                                 properties of the manager will be
325                                 shown. If a user is specified,
326                                 properties of the user are shown. By
327                                 default, empty properties are
328                                 suppressed. Use <option>--all</option>
329                                 to show those too. To select specific
330                                 properties to show, use
331                                 <option>--property=</option>. This
332                                 command is intended to be used
333                                 whenever computer-parsable output is
334                                 required. Use
335                                 <command>user-status</command> if
336                                 you are looking for formatted
337                                 human-readable
338                                 output.</para></listitem>
339                         </varlistentry>
340
341                         <varlistentry>
342                                 <term><command>enable-linger</command> <replaceable>USER</replaceable>...</term>
343                                 <term><command>disable-linger</command> <replaceable>USER</replaceable>...</term>
344
345                                 <listitem><para>Enable/disable user
346                                 lingering for one or more users. If
347                                 enabled for a specific user, a user
348                                 manager is spawned for the user at
349                                 boot and kept around after
350                                 logouts. This allows users who are not
351                                 logged in to run long-running
352                                 services.</para></listitem>
353                         </varlistentry>
354
355                         <varlistentry>
356                                 <term><command>terminate-user</command> <replaceable>USER</replaceable>...</term>
357
358                                 <listitem><para>Terminates all
359                                 sessions of a user. This kills all
360                                 processes of all sessions of the user
361                                 and deallocates all runtime resources
362                                 attached to the user.
363                                 </para></listitem>
364                         </varlistentry>
365
366                         <varlistentry>
367                                 <term><command>kill-user</command> <replaceable>USER</replaceable>...</term>
368
369                                 <listitem><para>Send a signal to all
370                                 processes of a user. Use
371                                 <option>--signal=</option> to select
372                                 the signal to send.</para></listitem>
373                         </varlistentry>
374
375                         <varlistentry>
376                                 <term><command>list-seats</command></term>
377
378                                 <listitem><para>List currently
379                                 available seats on the local
380                                 system.</para></listitem>
381                         </varlistentry>
382
383                         <varlistentry>
384                                 <term><command>seat-status</command> <replaceable>NAME</replaceable>...</term>
385
386                                 <listitem><para>Show terse runtime
387                                 status information about one or more
388                                 seats. This function is
389                                 intended to generate human-readable
390                                 output. If you are looking for
391                                 computer-parsable output, use
392                                 <command>show-seat</command>
393                                 instead.</para></listitem>
394                         </varlistentry>
395
396                         <varlistentry>
397                                 <term><command>show-seat</command> <replaceable>NAME</replaceable>...</term>
398
399                                 <listitem><para>Show properties of one
400                                 or more seats or the manager
401                                 itself. If no argument is specified,
402                                 properties of the manager will be
403                                 shown. If a seat is specified,
404                                 properties of the seat are shown. By
405                                 default, empty properties are
406                                 suppressed. Use <option>--all</option>
407                                 to show those too. To select specific
408                                 properties to show, use
409                                 <option>--property=</option>. This
410                                 command is intended to be used
411                                 whenever computer-parsable output is
412                                 required. Use
413                                 <command>seat-status</command> if you
414                                 are looking for formatted
415                                 human-readable
416                                 output.</para></listitem>
417                         </varlistentry>
418
419                         <varlistentry>
420                                 <term><command>attach</command> <replaceable>NAME</replaceable> <replaceable>DEVICE</replaceable>...</term>
421
422                                 <listitem><para>Persistently attach
423                                 one or more devices to a seat. The
424                                 devices should be specified via device
425                                 paths in the <filename>/sys</filename>
426                                 file system. To create a new seat,
427                                 attach at least one graphics card to a
428                                 previously unused seat name. Seat
429                                 names may consist only of a-z, A-Z,
430                                 0-9, <literal>-</literal> and
431                                 <literal>_</literal> and must be
432                                 prefixed with <literal>seat</literal>.
433                                 To drop assignment of a device to a
434                                 specific seat, just reassign it to a
435                                 different seat, or use
436                                 <command>flush-devices</command>.
437                                 </para></listitem>
438                         </varlistentry>
439
440                         <varlistentry>
441                                 <term><command>flush-devices</command></term>
442
443                                 <listitem><para>Removes all device
444                                 assignments previously created with
445                                 <command>attach</command>. After this
446                                 call, only automatically generated
447                                 seats will remain, and all seat
448                                 hardware is assigned to
449                                 them.</para></listitem>
450                         </varlistentry>
451
452                         <varlistentry>
453                                 <term><command>terminate-seat</command> <replaceable>NAME</replaceable>...</term>
454
455                                 <listitem><para>Terminates all
456                                 sessions on a seat. This kills all
457                                 processes of all sessions on the seat
458                                 and deallocates all runtime resources
459                                 attached to them.</para></listitem>
460                         </varlistentry>
461                 </variablelist>
462
463         </refsect1>
464
465         <refsect1>
466                 <title>Exit status</title>
467
468                 <para>On success, 0 is returned, a non-zero failure
469                 code otherwise.</para>
470         </refsect1>
471
472         <xi:include href="less-variables.xml" />
473
474         <refsect1>
475                 <title>See Also</title>
476                 <para>
477                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
478                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
479                         <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
480                         <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
481                 </para>
482         </refsect1>
483
484 </refentry>