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='HAVE_PAM'>
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>-h</option></term>
73 <term><option>--help</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>-p</option></term>
88 <term><option>--property=</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>-a</option></term>
105 <term><option>--all</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>
114 <term><option>--full</option></term>
116 <listitem><para>Do not ellipsize cgroup
122 <term><option>--no-pager</option></term>
124 <listitem><para>Do not pipe output into a
125 pager.</para></listitem>
129 <term><option>--no-ask-password</option></term>
131 <listitem><para>Don't query the user
132 for authentication for privileged
133 operations.</para></listitem>
137 <term><option>--kill-who=</option></term>
139 <listitem><para>When used with
140 <command>kill-session</command>,
141 choose which processes to kill. Must
142 be one of <option>leader</option>, or
143 <option>all</option> to select whether
144 to kill only the leader process of the
145 session or all processes of the
146 session. If omitted defaults to
147 <option>all</option>.</para></listitem>
151 <term><option>-s</option></term>
152 <term><option>--signal=</option></term>
154 <listitem><para>When used with
155 <command>kill-session</command> or
156 <command>kill-user</command>, choose
157 which signal to send to selected
158 processes. Must be one of the well
159 known signal specifiers such as
160 SIGTERM, SIGINT or SIGSTOP. If omitted
162 <option>SIGTERM</option>.</para></listitem>
166 <term><option>-H</option></term>
167 <term><option>--host</option></term>
169 <listitem><para>Execute operation
170 remotely. Specify a hostname, or
171 username and hostname separated by @,
172 to connect to. This will use SSH to
173 talk to the remote login manager
174 instance.</para></listitem>
178 <term><option>-P</option></term>
179 <term><option>--privileged</option></term>
181 <listitem><para>Acquire privileges via
182 PolicyKit before executing the
183 operation.</para></listitem>
187 <para>The following commands are understood:</para>
191 <term><command>list-sessions</command></term>
193 <listitem><para>List current sessions.</para></listitem>
197 <term><command>session-status [ID...]</command></term>
199 <listitem><para>Show terse runtime
200 status information about one or more
201 sessions. This function is intended to
202 generate human-readable output. If you
203 are looking for computer-parsable
205 <command>show-session</command>
206 instead.</para></listitem>
210 <term><command>show-session [ID...]</command></term>
212 <listitem><para>Show properties of one
213 or more sessions or the manager
214 itself. If no argument is specified
215 properties of the manager will be
216 shown. If a session ID is specified
217 properties of the session is shown. By
218 default, empty properties are
219 suppressed. Use <option>--all</option>
220 to show those too. To select specific
221 properties to show use
222 <option>--property=</option>. This
223 command is intended to be used
224 whenever computer-parsable output is
226 <command>session-status</command> if
227 you are looking for formatted
229 output.</para></listitem>
233 <term><command>activate [ID...]</command></term>
235 <listitem><para>Activate one or more
236 sessions. This brings one or more
237 sessions into the foreground, if
238 another session is currently in the
239 foreground on the respective
240 seat.</para></listitem>
244 <term><command>lock-session [ID...]</command></term>
245 <term><command>unlock-session [ID...]</command></term>
247 <listitem><para>Activates/deactivates
248 the screen lock on one or more
249 sessions, if the session supports it.</para></listitem>
253 <term><command>lock-sessions</command></term>
254 <term><command>unlock-sessions</command></term>
256 <listitem><para>Activates/deactivates
257 the screen lock on all current
259 it.</para></listitem>
263 <term><command>terminate-session [ID...]</command></term>
265 <listitem><para>Terminates a
266 session. This kills all processes of
267 the session and deallocates all
268 resources attached to the
269 session.</para></listitem>
273 <term><command>kill-session [ID...]</command></term>
275 <listitem><para>Send a signal to one
276 or more processes of the session. Use
277 <option>--kill-who=</option> to select
278 which process to kill. Use
279 <option>--signal=</option> to select
280 the signal to send.</para></listitem>
284 <term><command>list-users</command></term>
286 <listitem><para>List currently logged
287 in users.</para></listitem>
291 <term><command>user-status [USER...]</command></term>
293 <listitem><para>Show terse runtime
294 status information about one or more
295 logged in users. This function is
296 intended to generate human-readable
297 output. If you are looking for
298 computer-parsable output, use
299 <command>show-user</command>
300 instead. Users may be specified by
301 their usernames or numeric user
302 IDs.</para></listitem>
306 <term><command>show-user [USER...]</command></term>
308 <listitem><para>Show properties of one
309 or more users or the manager
310 itself. If no argument is specified
311 properties of the manager will be
312 shown. If a user is specified
313 properties of the user is shown. By
314 default, empty properties are
315 suppressed. Use <option>--all</option>
316 to show those too. To select specific
317 properties to show use
318 <option>--property=</option>. This
319 command is intended to be used
320 whenever computer-parsable output is
322 <command>user-status</command> if
323 you are looking for formatted
325 output.</para></listitem>
329 <term><command>enable-linger [USER...]</command></term>
330 <term><command>disable-linger [USER...]</command></term>
332 <listitem><para>Enable/disable user
333 lingering for one or more users. If
334 enabled for a specific user a user
335 manager is spawned for him/her at
336 boot, and kept around after
337 logouts. This allows users who aren't
338 logged in to run long-running
339 services.</para></listitem>
343 <term><command>terminate-user [USER...]</command></term>
345 <listitem><para>Terminates all
346 sessions of a user. This kills all
347 processes of all sessions of the user
348 and deallocates all runtime resources
350 user.</para></listitem>
354 <term><command>kill-user [USER...]</command></term>
356 <listitem><para>Send a signal to all
357 processes of a user. Use
358 <option>--signal=</option> to select
359 the signal to send.</para></listitem>
363 <term><command>list-seats</command></term>
365 <listitem><para>List currently
366 available seats on the local
367 system.</para></listitem>
371 <term><command>seat-status [NAME...]</command></term>
373 <listitem><para>Show terse runtime
374 status information about one or more
375 seats. This function is
376 intended to generate human-readable
377 output. If you are looking for
378 computer-parsable output, use
379 <command>show-seat</command>
380 instead.</para></listitem>
384 <term><command>show-seat [NAME...]</command></term>
386 <listitem><para>Show properties of one
387 or more seats or the manager
388 itself. If no argument is specified
389 properties of the manager will be
390 shown. If a seat is specified
391 properties of the seat are shown. By
392 default, empty properties are
393 suppressed. Use <option>--all</option>
394 to show those too. To select specific
395 properties to show use
396 <option>--property=</option>. This
397 command is intended to be used
398 whenever computer-parsable output is
400 <command>seat-status</command> if you
401 are looking for formatted
403 output.</para></listitem>
407 <term><command>attach [NAME] [DEVICE...]</command></term>
409 <listitem><para>Persistently attach
410 one or more devices to a seat. The
411 devices should be specified via device
412 paths in the <filename>/sys</filename>
413 file system. To create a new seat
414 attach at least one graphics card to a
415 previously unused seat name. Seat
416 names may consist only of a-z, A-Z,
417 0-9, "-" and "_" and must be prefixed
418 with "seat". To drop assignment of a
419 device to a specific seat just
420 reassign it to a different seat, or
422 <command>flush-devices</command>.</para></listitem>
426 <term><command>flush-devices</command></term>
428 <listitem><para>Removes all device
429 assignments previously created with
430 <command>attach</command>. After this
431 call only automatically generated
432 seats will remain and all seat
433 hardware is assigned to
434 them.</para></listitem>
438 <term><command>terminate-seat [NAME...]</command></term>
440 <listitem><para>Terminates all
441 sessions on a seat. This kills all
442 processes of all sessions on a seat and
443 deallocates all runtime resources
444 attached to them.</para></listitem>
451 <title>Exit status</title>
453 <para>On success 0 is returned, a non-zero failure
454 code otherwise.</para>
458 <title>Environment</title>
460 <variablelist class='environment-variables'>
462 <term><varname>$SYSTEMD_PAGER</varname></term>
463 <listitem><para>Pager to use when
464 <option>--no-pager</option> is not given;
465 overrides <varname>$PAGER</varname>. Setting
466 this to an empty string or the value
467 <literal>cat</literal> is equivalent to passing
468 <option>--no-pager</option>.</para></listitem>
474 <title>See Also</title>
476 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
477 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
478 <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
479 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>