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">
6 This file is part of systemd.
8 Copyright 2010 Lennart Poettering
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.
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.
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/>.
24 <refentry id="loginctl" conditional='ENABLE_LOGIND'
25 xmlns:xi="http://www.w3.org/2001/XInclude">
28 <title>loginctl</title>
29 <productname>systemd</productname>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
42 <refentrytitle>loginctl</refentrytitle>
43 <manvolnum>1</manvolnum>
47 <refname>loginctl</refname>
48 <refpurpose>Control the systemd login manager</refpurpose>
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>
61 <title>Description</title>
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>
70 <title>Options</title>
72 <para>The following options are understood:</para>
76 <term><option>--no-legend</option></term>
79 <para>Do not print the legend,
80 i.e. the column headers and
86 <term><option>--no-ask-password</option></term>
88 <listitem><para>Do not query the user
89 for authentication for privileged
90 operations.</para></listitem>
94 <term><option>-p</option></term>
95 <term><option>--property=</option></term>
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>
111 <term><option>-a</option></term>
112 <term><option>--all</option></term>
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>
121 <term><option>-l</option></term>
122 <term><option>--full</option></term>
124 <listitem><para>Do not ellipsize
125 process tree entries.</para>
130 <term><option>--kill-who=</option></term>
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>
144 <term><option>-s</option></term>
145 <term><option>--signal=</option></term>
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
157 <constant>SIGTERM</constant>.</para></listitem>
161 <term><option>-n</option></term>
162 <term><option>--lines=</option></term>
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>
175 <term><option>-o</option></term>
176 <term><option>--output=</option></term>
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>.
186 <literal>short</literal>.</para></listitem>
189 <xi:include href="user-system-options.xml" xpointer="host" />
190 <xi:include href="user-system-options.xml" xpointer="machine" />
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" />
199 <title>Commands</title>
201 <para>The following commands are understood:</para>
203 <refsect2><title>Session Commands</title><variablelist>
206 <term><command>list-sessions</command></term>
208 <listitem><para>List current sessions.</para></listitem>
212 <term><command>session-status</command> <optional><replaceable>ID</replaceable>...</optional></term>
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>
230 <term><command>show-session</command> <optional><replaceable>ID</replaceable>...</optional></term>
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
246 <command>session-status</command> if
247 you are looking for formatted
249 output.</para></listitem>
253 <term><command>activate</command> <replaceable>ID</replaceable></term>
255 <listitem><para>Activate a
256 session. This brings a session into
257 the foreground, if another session is
258 currently in the foreground on the
259 respective seat.</para></listitem>
263 <term><command>lock-session</command> <replaceable>ID</replaceable>...</term>
264 <term><command>unlock-session</command> <replaceable>ID</replaceable>...</term>
266 <listitem><para>Activates/deactivates
267 the screen lock on one or more
268 sessions, if the session supports it.
273 <term><command>lock-sessions</command></term>
274 <term><command>unlock-sessions</command></term>
276 <listitem><para>Activates/deactivates
277 the screen lock on all current
278 sessions supporting it.
283 <term><command>terminate-session</command> <replaceable>ID</replaceable>...</term>
285 <listitem><para>Terminates a session.
286 This kills all processes of the
287 session and deallocates all resources
288 attached to the session.
293 <term><command>kill-session</command> <replaceable>ID</replaceable>...</term>
295 <listitem><para>Send a signal to one
296 or more processes of the session. Use
297 <option>--kill-who=</option> to select
298 which process to kill. Use
299 <option>--signal=</option> to select
300 the signal to send.</para></listitem>
302 </variablelist></refsect2>
304 <refsect2><title>User Commands</title><variablelist>
306 <term><command>list-users</command></term>
308 <listitem><para>List currently logged
309 in users.</para></listitem>
313 <term><command>user-status</command> <optional><replaceable>USER</replaceable>...</optional></term>
315 <listitem><para>Show terse runtime
316 status information about one or more
317 logged in users, followed by the most
318 recent log data from the
319 journal. Takes one or more user names
320 or numeric user IDs as parameters. If
321 no parameters are passed the status of
322 the caller's user is shown. This
323 function is intended to generate
324 human-readable output. If you are
325 looking for computer-parsable output,
326 use <command>show-user</command>
327 instead. Users may be specified by
328 their usernames or numeric user IDs.
333 <term><command>show-user</command> <optional><replaceable>USER</replaceable>...</optional></term>
335 <listitem><para>Show properties of one
336 or more users or the manager
337 itself. If no argument is specified,
338 properties of the manager will be
339 shown. If a user is specified,
340 properties of the user are shown. By
341 default, empty properties are
342 suppressed. Use <option>--all</option>
343 to show those too. To select specific
344 properties to show, use
345 <option>--property=</option>. This
346 command is intended to be used
347 whenever computer-parsable output is
349 <command>user-status</command> if
350 you are looking for formatted
352 output.</para></listitem>
356 <term><command>enable-linger</command> <replaceable>USER</replaceable>...</term>
357 <term><command>disable-linger</command> <replaceable>USER</replaceable>...</term>
359 <listitem><para>Enable/disable user
360 lingering for one or more users. If
361 enabled for a specific user, a user
362 manager is spawned for the user at
363 boot and kept around after
364 logouts. This allows users who are not
365 logged in to run long-running
366 services.</para></listitem>
370 <term><command>terminate-user</command> <replaceable>USER</replaceable>...</term>
372 <listitem><para>Terminates all
373 sessions of a user. This kills all
374 processes of all sessions of the user
375 and deallocates all runtime resources
376 attached to the user.
381 <term><command>kill-user</command> <replaceable>USER</replaceable>...</term>
383 <listitem><para>Send a signal to all
384 processes of a user. Use
385 <option>--signal=</option> to select
386 the signal to send.</para></listitem>
388 </variablelist></refsect2>
390 <refsect2><title>Seat Commands</title><variablelist>
392 <term><command>list-seats</command></term>
394 <listitem><para>List currently
395 available seats on the local
396 system.</para></listitem>
400 <term><command>seat-status</command> <optional><replaceable>NAME</replaceable>...</optional></term>
402 <listitem><para>Show terse runtime
403 status information about one or more
404 seats. Takes one or more seat names as
405 parameters. If no seat names are
406 passed the status of the caller's
407 session's seat is shown. This function
408 is intended to generate human-readable
409 output. If you are looking for
410 computer-parsable output, use
411 <command>show-seat</command>
412 instead.</para></listitem>
416 <term><command>show-seat</command> <replaceable>NAME</replaceable>...</term>
418 <listitem><para>Show properties of one
419 or more seats or the manager
420 itself. If no argument is specified,
421 properties of the manager will be
422 shown. If a seat is specified,
423 properties of the seat are shown. By
424 default, empty properties are
425 suppressed. Use <option>--all</option>
426 to show those too. To select specific
427 properties to show, use
428 <option>--property=</option>. This
429 command is intended to be used
430 whenever computer-parsable output is
432 <command>seat-status</command> if you
433 are looking for formatted
435 output.</para></listitem>
439 <term><command>attach</command> <replaceable>NAME</replaceable> <replaceable>DEVICE</replaceable>...</term>
441 <listitem><para>Persistently attach
442 one or more devices to a seat. The
443 devices should be specified via device
444 paths in the <filename>/sys</filename>
445 file system. To create a new seat,
446 attach at least one graphics card to a
447 previously unused seat name. Seat
448 names may consist only of a-z, A-Z,
449 0-9, <literal>-</literal> and
450 <literal>_</literal> and must be
451 prefixed with <literal>seat</literal>.
452 To drop assignment of a device to a
453 specific seat, just reassign it to a
454 different seat, or use
455 <command>flush-devices</command>.
460 <term><command>flush-devices</command></term>
462 <listitem><para>Removes all device
463 assignments previously created with
464 <command>attach</command>. After this
465 call, only automatically generated
466 seats will remain, and all seat
467 hardware is assigned to
468 them.</para></listitem>
472 <term><command>terminate-seat</command> <replaceable>NAME</replaceable>...</term>
474 <listitem><para>Terminates all
475 sessions on a seat. This kills all
476 processes of all sessions on the seat
477 and deallocates all runtime resources
478 attached to them.</para></listitem>
480 </variablelist></refsect2>
485 <title>Exit status</title>
487 <para>On success, 0 is returned, a non-zero failure
488 code otherwise.</para>
491 <xi:include href="less-variables.xml" />
494 <title>See Also</title>
496 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
497 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
498 <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
499 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>