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'
>
27 <title>loginctl
</title>
28 <productname>systemd
</productname>
32 <contrib>Developer
</contrib>
33 <firstname>Lennart
</firstname>
34 <surname>Poettering
</surname>
35 <email>lennart@poettering.net
</email>
41 <refentrytitle>loginctl
</refentrytitle>
42 <manvolnum>1</manvolnum>
46 <refname>loginctl
</refname>
47 <refpurpose>Control the systemd login manager
</refpurpose>
52 <command>loginctl
</command>
53 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
54 <arg choice=
"req">COMMAND
</arg>
55 <arg choice=
"opt" rep=
"repeat">NAME
</arg>
60 <title>Description
</title>
62 <para><command>loginctl
</command> may be used to
63 introspect and control the state of the
64 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
65 login manager
<citerefentry><refentrytitle>systemd-logind.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
</para>
69 <title>Options
</title>
71 <para>The following options are understood:
</para>
75 <term><option>-h
</option></term>
76 <term><option>--help
</option></term>
78 <listitem><para>Prints a short help
79 text and exits.
</para></listitem>
83 <term><option>--version
</option></term>
85 <listitem><para>Prints a short version
86 string and exits.
</para></listitem>
90 <term><option>-p
</option></term>
91 <term><option>--property=
</option></term>
93 <listitem><para>When showing
94 session/user/seat properties, limit
95 display to certain properties as
96 specified as argument. If not
97 specified, all set properties are
98 shown. The argument should be a
99 property name, such as
100 <literal>Sessions
</literal>. If
101 specified more than once, all
102 properties with the specified names
103 are shown.
</para></listitem>
107 <term><option>-a
</option></term>
108 <term><option>--all
</option></term>
110 <listitem><para>When showing
111 session/user/seat properties, show all
112 properties regardless whether they are
113 set or not.
</para></listitem>
117 <term><option>-l
</option></term>
118 <term><option>--full
</option></term>
120 <listitem><para>Do not ellipsize
121 process tree entries.
</para>
126 <term><option>--no-pager
</option></term>
128 <listitem><para>Do not pipe output into a
129 pager.
</para></listitem>
133 <term><option>--no-ask-password
</option></term>
135 <listitem><para>Do not query the user
136 for authentication for privileged
137 operations.
</para></listitem>
141 <term><option>--kill-who=
</option></term>
143 <listitem><para>When used with
144 <command>kill-session
</command>,
145 choose which processes to kill. Must
146 be one of
<option>leader
</option>, or
147 <option>all
</option> to select whether
148 to kill only the leader process of the
149 session or all processes of the
150 session. If omitted, defaults to
151 <option>all
</option>.
</para></listitem>
155 <term><option>-s
</option></term>
156 <term><option>--signal=
</option></term>
158 <listitem><para>When used with
159 <command>kill-session
</command> or
160 <command>kill-user
</command>, choose
161 which signal to send to selected
162 processes. Must be one of the well
163 known signal specifiers, such as
164 <constant>SIGTERM
</constant>,
165 <constant>SIGINT
</constant> or
166 <constant>SIGSTOP
</constant>. If
168 <constant>SIGTERM
</constant>.
</para></listitem>
172 <term><option>-H
</option></term>
173 <term><option>--host
</option></term>
175 <listitem><para>Execute operation
176 remotely. Specify a hostname, or
177 username and hostname separated by
<literal>@
</literal>,
178 to connect to. This will use SSH to
179 talk to the remote login manager
180 instance.
</para></listitem>
184 <term><option>-P
</option></term>
185 <term><option>--privileged
</option></term>
187 <listitem><para>Acquire privileges via
188 PolicyKit before executing the
189 operation.
</para></listitem>
193 <para>The following commands are understood:
</para>
197 <term><command>list-sessions
</command></term>
199 <listitem><para>List current sessions.
</para></listitem>
203 <term><command>session-status [ID...]
</command></term>
205 <listitem><para>Show terse runtime
206 status information about one or more
207 sessions. This function is intended to
208 generate human-readable output. If you
209 are looking for computer-parsable
211 <command>show-session
</command>
212 instead.
</para></listitem>
216 <term><command>show-session [ID...]
</command></term>
218 <listitem><para>Show properties of one
219 or more sessions or the manager
220 itself. If no argument is specified,
221 properties of the manager will be
222 shown. If a session ID is specified,
223 properties of the session are shown. By
224 default, empty properties are
225 suppressed. Use
<option>--all
</option>
226 to show those too. To select specific
227 properties to show, use
228 <option>--property=
</option>. This
229 command is intended to be used
230 whenever computer-parsable output is
232 <command>session-status
</command> if
233 you are looking for formatted
235 output.
</para></listitem>
239 <term><command>activate [ID...]
</command></term>
241 <listitem><para>Activate one or more
242 sessions. This brings one or more
243 sessions into the foreground, if
244 another session is currently in the
245 foreground on the respective
246 seat.
</para></listitem>
250 <term><command>lock-session [ID...]
</command></term>
251 <term><command>unlock-session [ID...]
</command></term>
253 <listitem><para>Activates/deactivates
254 the screen lock on one or more
255 sessions, if the session supports it.
</para></listitem>
259 <term><command>lock-sessions
</command></term>
260 <term><command>unlock-sessions
</command></term>
262 <listitem><para>Activates/deactivates
263 the screen lock on all current
265 it.
</para></listitem>
269 <term><command>terminate-session [ID...]
</command></term>
271 <listitem><para>Terminates a
272 session. This kills all processes of
273 the session and deallocates all
274 resources attached to the
275 session.
</para></listitem>
279 <term><command>kill-session [ID...]
</command></term>
281 <listitem><para>Send a signal to one
282 or more processes of the session. Use
283 <option>--kill-who=
</option> to select
284 which process to kill. Use
285 <option>--signal=
</option> to select
286 the signal to send.
</para></listitem>
290 <term><command>list-users
</command></term>
292 <listitem><para>List currently logged
293 in users.
</para></listitem>
297 <term><command>user-status [USER...]
</command></term>
299 <listitem><para>Show terse runtime
300 status information about one or more
301 logged in users. This function is
302 intended to generate human-readable
303 output. If you are looking for
304 computer-parsable output, use
305 <command>show-user
</command>
306 instead. Users may be specified by
307 their usernames or numeric user
308 IDs.
</para></listitem>
312 <term><command>show-user [USER...]
</command></term>
314 <listitem><para>Show properties of one
315 or more users or the manager
316 itself. If no argument is specified,
317 properties of the manager will be
318 shown. If a user is specified,
319 properties of the user are shown. By
320 default, empty properties are
321 suppressed. Use
<option>--all
</option>
322 to show those too. To select specific
323 properties to show, use
324 <option>--property=
</option>. This
325 command is intended to be used
326 whenever computer-parsable output is
328 <command>user-status
</command> if
329 you are looking for formatted
331 output.
</para></listitem>
335 <term><command>enable-linger [USER...]
</command></term>
336 <term><command>disable-linger [USER...]
</command></term>
338 <listitem><para>Enable/disable user
339 lingering for one or more users. If
340 enabled for a specific user, a user
341 manager is spawned for him/her at
342 boot and kept around after
343 logouts. This allows users who are not
344 logged in to run long-running
345 services.
</para></listitem>
349 <term><command>terminate-user [USER...]
</command></term>
351 <listitem><para>Terminates all
352 sessions of a user. This kills all
353 processes of all sessions of the user
354 and deallocates all runtime resources
356 user.
</para></listitem>
360 <term><command>kill-user [USER...]
</command></term>
362 <listitem><para>Send a signal to all
363 processes of a user. Use
364 <option>--signal=
</option> to select
365 the signal to send.
</para></listitem>
369 <term><command>list-seats
</command></term>
371 <listitem><para>List currently
372 available seats on the local
373 system.
</para></listitem>
377 <term><command>seat-status [NAME...]
</command></term>
379 <listitem><para>Show terse runtime
380 status information about one or more
381 seats. This function is
382 intended to generate human-readable
383 output. If you are looking for
384 computer-parsable output, use
385 <command>show-seat
</command>
386 instead.
</para></listitem>
390 <term><command>show-seat [NAME...]
</command></term>
392 <listitem><para>Show properties of one
393 or more seats or the manager
394 itself. If no argument is specified,
395 properties of the manager will be
396 shown. If a seat is specified,
397 properties of the seat are shown. By
398 default, empty properties are
399 suppressed. Use
<option>--all
</option>
400 to show those too. To select specific
401 properties to show, use
402 <option>--property=
</option>. This
403 command is intended to be used
404 whenever computer-parsable output is
406 <command>seat-status
</command> if you
407 are looking for formatted
409 output.
</para></listitem>
413 <term><command>attach [NAME] [DEVICE...]
</command></term>
415 <listitem><para>Persistently attach
416 one or more devices to a seat. The
417 devices should be specified via device
418 paths in the
<filename>/sys
</filename>
419 file system. To create a new seat,
420 attach at least one graphics card to a
421 previously unused seat name. Seat
422 names may consist only of a-z, A-Z,
423 0-
9,
<literal>-
</literal> and
424 <literal>_
</literal> and must be
425 prefixed with
<literal>seat
</literal>.
426 To drop assignment of a device to a
427 specific seat, just reassign it to a
428 different seat, or use
429 <command>flush-devices
</command>.
434 <term><command>flush-devices
</command></term>
436 <listitem><para>Removes all device
437 assignments previously created with
438 <command>attach
</command>. After this
439 call, only automatically generated
440 seats will remain, and all seat
441 hardware is assigned to
442 them.
</para></listitem>
446 <term><command>terminate-seat [NAME...]
</command></term>
448 <listitem><para>Terminates all
449 sessions on a seat. This kills all
450 processes of all sessions on a seat and
451 deallocates all runtime resources
452 attached to them.
</para></listitem>
459 <title>Exit status
</title>
461 <para>On success,
0 is returned, a non-zero failure
462 code otherwise.
</para>
466 <title>Environment
</title>
468 <variablelist class='environment-variables'
>
470 <term><varname>$SYSTEMD_PAGER
</varname></term>
471 <listitem><para>Pager to use when
472 <option>--no-pager
</option> is not given;
473 overrides
<varname>$PAGER
</varname>. Setting
474 this to an empty string or the value
475 <literal>cat
</literal> is equivalent to passing
476 <option>--no-pager
</option>.
</para></listitem>
482 <title>See Also
</title>
484 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
485 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
486 <citerefentry><refentrytitle>systemd-logind.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
487 <citerefentry><refentrytitle>logind.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>