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>
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>terminate-session [ID...]</command></term>
248 <listitem><para>Terminates a
249 session. This kills all processes of
250 the session and deallocates all
251 resources attached to the
252 session.</para></listitem>
256 <term><command>kill-session [ID...]</command></term>
258 <listitem><para>Send a signal to one
259 or more processes of the session. Use
260 <option>--kill-who=</option> to select
261 which process to kill. Use
262 <option>--signal=</option> to select
263 the signal to send.</para></listitem>
267 <term><command>list-users</command></term>
269 <listitem><para>List currently logged
270 in users.</para></listitem>
274 <term><command>user-status [USER...]</command></term>
276 <listitem><para>Show terse runtime
277 status information about one or more
278 logged in users. This function is
279 intended to generate human-readable
280 output. If you are looking for
281 computer-parsable output, use
282 <command>show-user</command>
283 instead. Users may be specified by
284 their usernames or numeric user
285 IDs.</para></listitem>
289 <term><command>show-user [USER...]</command></term>
291 <listitem><para>Show properties of one
292 or more users or the manager
293 itself. If no argument is specified
294 properties of the manager will be
295 shown. If a user is specified
296 properties of the user is shown. By
297 default, empty properties are
298 suppressed. Use <option>--all</option>
299 to show those too. To select specific
300 properties to show use
301 <option>--property=</option>. This
302 command is intended to be used
303 whenever computer-parsable output is
305 <command>user-status</command> if
306 you are looking for formatted
308 output.</para></listitem>
312 <term><command>enable-linger [USER...]</command></term>
313 <term><command>disable-linger [USER...]</command></term>
315 <listitem><para>Enable/disable user
316 lingering for one or more users. If
317 enabled for a specific user a user
318 manager is spawned for him/her at
319 boot, and kept around after
320 logouts. This allows users who aren't
321 logged in to run long-running
322 services.</para></listitem>
326 <term><command>terminate-user [USER...]</command></term>
328 <listitem><para>Terminates all
329 sessions of a user. This kills all
330 processes of all sessions of the user
331 and deallocates all runtime resources
333 user.</para></listitem>
337 <term><command>kill-user [USER...]</command></term>
339 <listitem><para>Send a signal to all
340 processes of a user. Use
341 <option>--signal=</option> to select
342 the signal to send.</para></listitem>
346 <term><command>list-seats</command></term>
348 <listitem><para>List currently
349 available seats on the local
350 system.</para></listitem>
354 <term><command>seat-status [NAME...]</command></term>
356 <listitem><para>Show terse runtime
357 status information about one or more
358 seats. This function is
359 intended to generate human-readable
360 output. If you are looking for
361 computer-parsable output, use
362 <command>show-seat</command>
363 instead.</para></listitem>
367 <term><command>show-seat [NAME...]</command></term>
369 <listitem><para>Show properties of one
370 or more seats or the manager
371 itself. If no argument is specified
372 properties of the manager will be
373 shown. If a seat is specified
374 properties of the seat are shown. By
375 default, empty properties are
376 suppressed. Use <option>--all</option>
377 to show those too. To select specific
378 properties to show use
379 <option>--property=</option>. This
380 command is intended to be used
381 whenever computer-parsable output is
383 <command>seat-status</command> if you
384 are looking for formatted
386 output.</para></listitem>
390 <term><command>attach [NAME] [DEVICE...]</command></term>
392 <listitem><para>Attach one or more
393 devices to a seat. The devices should
394 be specified via device paths in the
395 <filename>/sys</filename> file
396 system. To create a new seat attach at
397 least one graphics card to a
398 previously unused seat names. seat
399 names may consist only of a-z, A-Z,
400 0-9, "-" and "_" and must be prefixed
401 with "seat". To drop assignment of a
402 device to a specific seat just
403 reassign it to a different seat, or
405 <command>flush-devices</command>.</para></listitem>
409 <term><command>flush-devices</command></term>
411 <listitem><para>Removes all device
412 assignments previously created with
413 <command>attach</command>. After this
414 call only automatically generated
415 seats will remain and all seat
416 hardware is assigned to
417 them.</para></listitem>
421 <term><command>terminate-seat [NAME...]</command></term>
423 <listitem><para>Terminates all
424 sessions on a seat. This kills all
425 processes of all sessions on a seat and
426 deallocates all runtime resources
427 attached to them.</para></listitem>
434 <title>Exit status</title>
436 <para>On success 0 is returned, a non-zero failure
437 code otherwise.</para>
441 <title>Environment</title>
445 <term><varname>$SYSTEMD_PAGER</varname></term>
446 <listitem><para>Pager to use when
447 <option>--no-pager</option> is not given;
448 overrides <varname>$PAGER</varname>. Setting
449 this to an empty string or the value
450 <literal>cat</literal> is equivalent to passing
451 <option>--no-pager</option>.</para></listitem>
457 <title>See Also</title>
459 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
460 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
461 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>