chiark / gitweb /
095ba056aa860b4bf72a5f5db8657cd2149f11ec
[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         </refsect1>
197
198         <refsect1>
199                 <title>Commands</title>
200
201                 <para>The following commands are understood:</para>
202
203                 <refsect2><title>Session Commands</title><variablelist>
204
205                         <varlistentry>
206                                 <term><command>list-sessions</command></term>
207
208                                 <listitem><para>List current sessions.</para></listitem>
209                         </varlistentry>
210
211                         <varlistentry>
212                                 <term><command>session-status</command> <optional><replaceable>ID</replaceable>...</optional></term>
213
214                                 <listitem><para>Show terse runtime
215                                 status information about one or more
216                                 sessions, followed by the most recent
217                                 log data from the journal. Takes one
218                                 or more session identifiers as
219                                 parameters. If no session identifiers
220                                 are passed the status of the caller's
221                                 session is shown. This function is
222                                 intended to generate human-readable
223                                 output. If you are looking for
224                                 computer-parsable output, use
225                                 <command>show-session</command>
226                                 instead.</para></listitem>
227                         </varlistentry>
228
229                         <varlistentry>
230                                 <term><command>show-session</command> <optional><replaceable>ID</replaceable>...</optional></term>
231
232                                 <listitem><para>Show properties of one
233                                 or more sessions or the manager
234                                 itself. If no argument is specified,
235                                 properties of the manager will be
236                                 shown. If a session ID is specified,
237                                 properties of the session are shown. By
238                                 default, empty properties are
239                                 suppressed. Use <option>--all</option>
240                                 to show those too. To select specific
241                                 properties to show, use
242                                 <option>--property=</option>. This
243                                 command is intended to be used
244                                 whenever computer-parsable output is
245                                 required. Use
246                                 <command>session-status</command> if
247                                 you are looking for formatted
248                                 human-readable
249                                 output.</para></listitem>
250                         </varlistentry>
251
252                         <varlistentry>
253                                 <term><command>activate</command> <replaceable>ID</replaceable>...</term>
254
255                                 <listitem><para>Activate one or more
256                                 sessions. This brings one or more
257                                 sessions into the foreground, if
258                                 another session is currently in the
259                                 foreground on the respective
260                                 seat.</para></listitem>
261                         </varlistentry>
262
263                         <varlistentry>
264                                 <term><command>lock-session</command> <replaceable>ID</replaceable>...</term>
265                                 <term><command>unlock-session</command> <replaceable>ID</replaceable>...</term>
266
267                                 <listitem><para>Activates/deactivates
268                                 the screen lock on one or more
269                                 sessions, if the session supports it.
270                                 </para></listitem>
271                         </varlistentry>
272
273                         <varlistentry>
274                                 <term><command>lock-sessions</command></term>
275                                 <term><command>unlock-sessions</command></term>
276
277                                 <listitem><para>Activates/deactivates
278                                 the screen lock on all current
279                                 sessions supporting it.
280                                 </para></listitem>
281                         </varlistentry>
282
283                         <varlistentry>
284                                 <term><command>terminate-session</command> <replaceable>ID</replaceable>...</term>
285
286                                 <listitem><para>Terminates a session.
287                                 This kills all processes of the
288                                 session and deallocates all resources
289                                 attached to the session.
290                                 </para></listitem>
291                         </varlistentry>
292
293                         <varlistentry>
294                                 <term><command>kill-session</command> <replaceable>ID</replaceable>...</term>
295
296                                 <listitem><para>Send a signal to one
297                                 or more processes of the session. Use
298                                 <option>--kill-who=</option> to select
299                                 which process to kill. Use
300                                 <option>--signal=</option> to select
301                                 the signal to send.</para></listitem>
302                         </varlistentry>
303                 </variablelist></refsect2>
304
305                 <refsect2><title>User Commands</title><variablelist>
306                         <varlistentry>
307                                 <term><command>list-users</command></term>
308
309                                 <listitem><para>List currently logged
310                                 in users.</para></listitem>
311                         </varlistentry>
312
313                         <varlistentry>
314                                 <term><command>user-status</command> <optional><replaceable>USER</replaceable>...</optional></term>
315
316                                 <listitem><para>Show terse runtime
317                                 status information about one or more
318                                 logged in users, followed by the most
319                                 recent log data from the
320                                 journal. Takes one or more user names
321                                 or numeric user IDs as parameters. If
322                                 no parameters are passed the status of
323                                 the caller's user is shown. This
324                                 function is intended to generate
325                                 human-readable output. If you are
326                                 looking for computer-parsable output,
327                                 use <command>show-user</command>
328                                 instead.  Users may be specified by
329                                 their usernames or numeric user IDs.
330                                 </para></listitem>
331                         </varlistentry>
332
333                         <varlistentry>
334                                 <term><command>show-user</command> <optional><replaceable>USER</replaceable>...</optional></term>
335
336                                 <listitem><para>Show properties of one
337                                 or more users or the manager
338                                 itself. If no argument is specified,
339                                 properties of the manager will be
340                                 shown. If a user is specified,
341                                 properties of the user are shown. By
342                                 default, empty properties are
343                                 suppressed. Use <option>--all</option>
344                                 to show those too. To select specific
345                                 properties to show, use
346                                 <option>--property=</option>. This
347                                 command is intended to be used
348                                 whenever computer-parsable output is
349                                 required. Use
350                                 <command>user-status</command> if
351                                 you are looking for formatted
352                                 human-readable
353                                 output.</para></listitem>
354                         </varlistentry>
355
356                         <varlistentry>
357                                 <term><command>enable-linger</command> <replaceable>USER</replaceable>...</term>
358                                 <term><command>disable-linger</command> <replaceable>USER</replaceable>...</term>
359
360                                 <listitem><para>Enable/disable user
361                                 lingering for one or more users. If
362                                 enabled for a specific user, a user
363                                 manager is spawned for the user at
364                                 boot and kept around after
365                                 logouts. This allows users who are not
366                                 logged in to run long-running
367                                 services.</para></listitem>
368                         </varlistentry>
369
370                         <varlistentry>
371                                 <term><command>terminate-user</command> <replaceable>USER</replaceable>...</term>
372
373                                 <listitem><para>Terminates all
374                                 sessions of a user. This kills all
375                                 processes of all sessions of the user
376                                 and deallocates all runtime resources
377                                 attached to the user.
378                                 </para></listitem>
379                         </varlistentry>
380
381                         <varlistentry>
382                                 <term><command>kill-user</command> <replaceable>USER</replaceable>...</term>
383
384                                 <listitem><para>Send a signal to all
385                                 processes of a user. Use
386                                 <option>--signal=</option> to select
387                                 the signal to send.</para></listitem>
388                         </varlistentry>
389                 </variablelist></refsect2>
390
391                 <refsect2><title>Seat Commands</title><variablelist>
392                         <varlistentry>
393                                 <term><command>list-seats</command></term>
394
395                                 <listitem><para>List currently
396                                 available seats on the local
397                                 system.</para></listitem>
398                         </varlistentry>
399
400                         <varlistentry>
401                                 <term><command>seat-status</command> <optional><replaceable>NAME</replaceable>...</optional></term>
402
403                                 <listitem><para>Show terse runtime
404                                 status information about one or more
405                                 seats. Takes one or more seat names as
406                                 parameters. If no seat names are
407                                 passed the status of the caller's
408                                 session's seat is shown. This function
409                                 is intended to generate human-readable
410                                 output. If you are looking for
411                                 computer-parsable output, use
412                                 <command>show-seat</command>
413                                 instead.</para></listitem>
414                         </varlistentry>
415
416                         <varlistentry>
417                                 <term><command>show-seat</command> <replaceable>NAME</replaceable>...</term>
418
419                                 <listitem><para>Show properties of one
420                                 or more seats or the manager
421                                 itself. If no argument is specified,
422                                 properties of the manager will be
423                                 shown. If a seat is specified,
424                                 properties of the seat are shown. By
425                                 default, empty properties are
426                                 suppressed. Use <option>--all</option>
427                                 to show those too. To select specific
428                                 properties to show, use
429                                 <option>--property=</option>. This
430                                 command is intended to be used
431                                 whenever computer-parsable output is
432                                 required. Use
433                                 <command>seat-status</command> if you
434                                 are looking for formatted
435                                 human-readable
436                                 output.</para></listitem>
437                         </varlistentry>
438
439                         <varlistentry>
440                                 <term><command>attach</command> <replaceable>NAME</replaceable> <replaceable>DEVICE</replaceable>...</term>
441
442                                 <listitem><para>Persistently attach
443                                 one or more devices to a seat. The
444                                 devices should be specified via device
445                                 paths in the <filename>/sys</filename>
446                                 file system. To create a new seat,
447                                 attach at least one graphics card to a
448                                 previously unused seat name. Seat
449                                 names may consist only of a-z, A-Z,
450                                 0-9, <literal>-</literal> and
451                                 <literal>_</literal> and must be
452                                 prefixed with <literal>seat</literal>.
453                                 To drop assignment of a device to a
454                                 specific seat, just reassign it to a
455                                 different seat, or use
456                                 <command>flush-devices</command>.
457                                 </para></listitem>
458                         </varlistentry>
459
460                         <varlistentry>
461                                 <term><command>flush-devices</command></term>
462
463                                 <listitem><para>Removes all device
464                                 assignments previously created with
465                                 <command>attach</command>. After this
466                                 call, only automatically generated
467                                 seats will remain, and all seat
468                                 hardware is assigned to
469                                 them.</para></listitem>
470                         </varlistentry>
471
472                         <varlistentry>
473                                 <term><command>terminate-seat</command> <replaceable>NAME</replaceable>...</term>
474
475                                 <listitem><para>Terminates all
476                                 sessions on a seat. This kills all
477                                 processes of all sessions on the seat
478                                 and deallocates all runtime resources
479                                 attached to them.</para></listitem>
480                         </varlistentry>
481                 </variablelist></refsect2>
482
483         </refsect1>
484
485         <refsect1>
486                 <title>Exit status</title>
487
488                 <para>On success, 0 is returned, a non-zero failure
489                 code otherwise.</para>
490         </refsect1>
491
492         <xi:include href="less-variables.xml" />
493
494         <refsect1>
495                 <title>See Also</title>
496                 <para>
497                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
498                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
499                         <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
500                         <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
501                 </para>
502         </refsect1>
503
504 </refentry>