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">
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 <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
57 <title>Description</title>
59 <para><command>loginctl</command> may be used to
60 introspect and control the state of the
61 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
62 login manager <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
66 <title>Options</title>
68 <para>The following options are understood:</para>
72 <term><option>--help</option></term>
73 <term><option>-h</option></term>
75 <listitem><para>Prints a short help
76 text and exits.</para></listitem>
80 <term><option>--version</option></term>
82 <listitem><para>Prints a short version
83 string and exits.</para></listitem>
87 <term><option>--property=</option></term>
88 <term><option>-p</option></term>
90 <listitem><para>When showing
91 session/user properties, limit
92 display to certain properties as
93 specified as argument. If not
94 specified all set properties are
95 shown. The argument should be a
96 property name, such as
97 <literal>Sessions</literal>. If
98 specified more than once all
99 properties with the specified names
100 are shown.</para></listitem>
104 <term><option>--all</option></term>
105 <term><option>-a</option></term>
107 <listitem><para>When showing
108 unit/job/manager properties, show all
109 properties regardless whether they are
110 set or not.</para></listitem>
115 <term><option>--no-pager</option></term>
117 <listitem><para>Do not pipe output into a
118 pager.</para></listitem>
122 <term><option>--no-ask-password</option></term>
124 <listitem><para>Don't query the user
125 for authentication for privileged
126 operations.</para></listitem>
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>--signal=</option></term>
145 <term><option>-s</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 SIGTERM, SIGINT or SIGSTOP. If omitted
155 <option>SIGTERM</option>.</para></listitem>
159 <term><option>-H</option></term>
160 <term><option>--host</option></term>
162 <listitem><para>Execute operation
163 remotely. Specify a hostname, or
164 username and hostname separated by @,
165 to connect to. This will use SSH to
166 talk to the remote login manager
167 instance.</para></listitem>
171 <term><option>-P</option></term>
172 <term><option>--privileged</option></term>
174 <listitem><para>Acquire privileges via
175 PolicyKit before executing the
176 operation.</para></listitem>
180 <para>The following commands are understood:</para>
184 <term><command>list-sessions</command></term>
186 <listitem><para>List current sessions.</para></listitem>
190 <term><command>session-status [ID...]</command></term>
192 <listitem><para>Show terse runtime
193 status information about one or more
194 sessions. This function is intended to
195 generate human-readable output. If you
196 are looking for computer-parsable
198 <command>show-session</command>
199 instead.</para></listitem>
203 <term><command>show-session [ID...]</command></term>
205 <listitem><para>Show properties of one
206 or more sessions or the manager
207 itself. If no argument is specified
208 properties of the manager will be
209 shown. If a session ID is specified
210 properties of the session is shown. By
211 default, empty properties are
212 suppressed. Use <option>--all</option>
213 to show those too. To select specific
214 properties to show use
215 <option>--property=</option>. This
216 command is intended to be used
217 whenever computer-parsable output is
219 <command>session-status</command> if
220 you are looking for formatted
222 output.</para></listitem>
226 <term><command>activate [ID...]</command></term>
228 <listitem><para>Activate one or more
229 sessions. This brings one or more
230 sessions into the foreground, if
231 another session is currently in the
232 foreground on the respective
233 seat.</para></listitem>
237 <term><command>lock-session [ID...]</command></term>
238 <term><command>unlock-session [ID...]</command></term>
240 <listitem><para>Activates/deactivates
241 the screen lock on one or more
242 sessions, if the session supports it.</para></listitem>
246 <term><command>lock-sessions</command></term>
248 <listitem><para>Activate the screen
249 lock on all current sessions
250 supporting it.</para></listitem>
254 <term><command>terminate-session [ID...]</command></term>
256 <listitem><para>Terminates a
257 session. This kills all processes of
258 the session and deallocates all
259 resources attached to the
260 session.</para></listitem>
264 <term><command>kill-session [ID...]</command></term>
266 <listitem><para>Send a signal to one
267 or more processes of the session. Use
268 <option>--kill-who=</option> to select
269 which process to kill. Use
270 <option>--signal=</option> to select
271 the signal to send.</para></listitem>
275 <term><command>list-users</command></term>
277 <listitem><para>List currently logged
278 in users.</para></listitem>
282 <term><command>user-status [USER...]</command></term>
284 <listitem><para>Show terse runtime
285 status information about one or more
286 logged in users. This function is
287 intended to generate human-readable
288 output. If you are looking for
289 computer-parsable output, use
290 <command>show-user</command>
291 instead. Users may be specified by
292 their usernames or numeric user
293 IDs.</para></listitem>
297 <term><command>show-user [USER...]</command></term>
299 <listitem><para>Show properties of one
300 or more users or the manager
301 itself. If no argument is specified
302 properties of the manager will be
303 shown. If a user is specified
304 properties of the user is shown. By
305 default, empty properties are
306 suppressed. Use <option>--all</option>
307 to show those too. To select specific
308 properties to show use
309 <option>--property=</option>. This
310 command is intended to be used
311 whenever computer-parsable output is
313 <command>user-status</command> if
314 you are looking for formatted
316 output.</para></listitem>
320 <term><command>enable-linger [USER...]</command></term>
321 <term><command>disable-linger [USER...]</command></term>
323 <listitem><para>Enable/disable user
324 lingering for one or more users. If
325 enabled for a specific user a user
326 manager is spawned for him/her at
327 boot, and kept around after
328 logouts. This allows users who aren't
329 logged in to run long-running
330 services.</para></listitem>
334 <term><command>terminate-user [USER...]</command></term>
336 <listitem><para>Terminates all
337 sessions of a user. This kills all
338 processes of all sessions of the user
339 and deallocates all runtime resources
341 user.</para></listitem>
345 <term><command>kill-user [USER...]</command></term>
347 <listitem><para>Send a signal to all
348 processes of a user. Use
349 <option>--signal=</option> to select
350 the signal to send.</para></listitem>
354 <term><command>list-seats</command></term>
356 <listitem><para>List currently
357 available seats on the local
358 system.</para></listitem>
362 <term><command>seat-status [NAME...]</command></term>
364 <listitem><para>Show terse runtime
365 status information about one or more
366 seats. This function is
367 intended to generate human-readable
368 output. If you are looking for
369 computer-parsable output, use
370 <command>show-seat</command>
371 instead.</para></listitem>
375 <term><command>show-seat [NAME...]</command></term>
377 <listitem><para>Show properties of one
378 or more seats or the manager
379 itself. If no argument is specified
380 properties of the manager will be
381 shown. If a seat is specified
382 properties of the seat are shown. By
383 default, empty properties are
384 suppressed. Use <option>--all</option>
385 to show those too. To select specific
386 properties to show use
387 <option>--property=</option>. This
388 command is intended to be used
389 whenever computer-parsable output is
391 <command>seat-status</command> if you
392 are looking for formatted
394 output.</para></listitem>
398 <term><command>attach [NAME] [DEVICE...]</command></term>
400 <listitem><para>Persistently attach
401 one or more devices to a seat. The
402 devices should be specified via device
403 paths in the <filename>/sys</filename>
404 file system. To create a new seat
405 attach at least one graphics card to a
406 previously unused seat name. Seat
407 names may consist only of a-z, A-Z,
408 0-9, "-" and "_" and must be prefixed
409 with "seat". To drop assignment of a
410 device to a specific seat just
411 reassign it to a different seat, or
413 <command>flush-devices</command>.</para></listitem>
417 <term><command>flush-devices</command></term>
419 <listitem><para>Removes all device
420 assignments previously created with
421 <command>attach</command>. After this
422 call only automatically generated
423 seats will remain and all seat
424 hardware is assigned to
425 them.</para></listitem>
429 <term><command>terminate-seat [NAME...]</command></term>
431 <listitem><para>Terminates all
432 sessions on a seat. This kills all
433 processes of all sessions on a seat and
434 deallocates all runtime resources
435 attached to them.</para></listitem>
442 <title>Exit status</title>
444 <para>On success 0 is returned, a non-zero failure
445 code otherwise.</para>
449 <title>Environment</title>
453 <term><varname>$SYSTEMD_PAGER</varname></term>
454 <listitem><para>Pager to use when
455 <option>--no-pager</option> is not given;
456 overrides <varname>$PAGER</varname>. Setting
457 this to an empty string or the value
458 <literal>cat</literal> is equivalent to passing
459 <option>--no-pager</option>.</para></listitem>
465 <title>See Also</title>
467 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
468 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
469 <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
470 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>