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