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" />
197 <para>The following commands are understood:</para>
201 <term><command>list-sessions</command></term>
203 <listitem><para>List current sessions.</para></listitem>
207 <term><command>session-status</command> <replaceable>ID</replaceable>...</term>
209 <listitem><para>Show terse runtime
210 status information about one or more
211 sessions, followed by the most recent
212 log data from the journal. This
213 function is intended to generate
214 human-readable output. If you are
215 looking for computer-parsable output,
216 use <command>show-session</command>
217 instead.</para></listitem>
221 <term><command>show-session</command> <optional><replaceable>ID</replaceable>...</optional></term>
223 <listitem><para>Show properties of one
224 or more sessions or the manager
225 itself. If no argument is specified,
226 properties of the manager will be
227 shown. If a session ID is specified,
228 properties of the session are shown. By
229 default, empty properties are
230 suppressed. Use <option>--all</option>
231 to show those too. To select specific
232 properties to show, use
233 <option>--property=</option>. This
234 command is intended to be used
235 whenever computer-parsable output is
237 <command>session-status</command> if
238 you are looking for formatted
240 output.</para></listitem>
244 <term><command>activate</command> <replaceable>ID</replaceable>...</term>
246 <listitem><para>Activate one or more
247 sessions. This brings one or more
248 sessions into the foreground, if
249 another session is currently in the
250 foreground on the respective
251 seat.</para></listitem>
255 <term><command>lock-session</command> <replaceable>ID</replaceable>...</term>
256 <term><command>unlock-session</command> <replaceable>ID</replaceable>...</term>
258 <listitem><para>Activates/deactivates
259 the screen lock on one or more
260 sessions, if the session supports it.
265 <term><command>lock-sessions</command></term>
266 <term><command>unlock-sessions</command></term>
268 <listitem><para>Activates/deactivates
269 the screen lock on all current
270 sessions supporting it.
275 <term><command>terminate-session</command> <replaceable>ID</replaceable>...</term>
277 <listitem><para>Terminates a session.
278 This kills all processes of the
279 session and deallocates all resources
280 attached to the session.
285 <term><command>kill-session</command> <replaceable>ID</replaceable>...</term>
287 <listitem><para>Send a signal to one
288 or more processes of the session. Use
289 <option>--kill-who=</option> to select
290 which process to kill. Use
291 <option>--signal=</option> to select
292 the signal to send.</para></listitem>
296 <term><command>list-users</command></term>
298 <listitem><para>List currently logged
299 in users.</para></listitem>
303 <term><command>user-status</command> <replaceable>USER</replaceable>...</term>
305 <listitem><para>Show terse runtime
306 status information about one or more
307 logged in users, followed by the most
308 recent log data from the journal. This
309 function is intended to generate
310 human-readable output. If you are
311 looking for computer-parsable output,
312 use <command>show-user</command>
313 instead. Users may be specified by
314 their usernames or numeric user IDs.
319 <term><command>show-user</command> <optional><replaceable>USER</replaceable>...</optional></term>
321 <listitem><para>Show properties of one
322 or more users or the manager
323 itself. If no argument is specified,
324 properties of the manager will be
325 shown. If a user is specified,
326 properties of the user are shown. By
327 default, empty properties are
328 suppressed. Use <option>--all</option>
329 to show those too. To select specific
330 properties to show, use
331 <option>--property=</option>. This
332 command is intended to be used
333 whenever computer-parsable output is
335 <command>user-status</command> if
336 you are looking for formatted
338 output.</para></listitem>
342 <term><command>enable-linger</command> <replaceable>USER</replaceable>...</term>
343 <term><command>disable-linger</command> <replaceable>USER</replaceable>...</term>
345 <listitem><para>Enable/disable user
346 lingering for one or more users. If
347 enabled for a specific user, a user
348 manager is spawned for the user at
349 boot and kept around after
350 logouts. This allows users who are not
351 logged in to run long-running
352 services.</para></listitem>
356 <term><command>terminate-user</command> <replaceable>USER</replaceable>...</term>
358 <listitem><para>Terminates all
359 sessions of a user. This kills all
360 processes of all sessions of the user
361 and deallocates all runtime resources
362 attached to the user.
367 <term><command>kill-user</command> <replaceable>USER</replaceable>...</term>
369 <listitem><para>Send a signal to all
370 processes of a user. Use
371 <option>--signal=</option> to select
372 the signal to send.</para></listitem>
376 <term><command>list-seats</command></term>
378 <listitem><para>List currently
379 available seats on the local
380 system.</para></listitem>
384 <term><command>seat-status</command> <replaceable>NAME</replaceable>...</term>
386 <listitem><para>Show terse runtime
387 status information about one or more
388 seats. This function is
389 intended to generate human-readable
390 output. If you are looking for
391 computer-parsable output, use
392 <command>show-seat</command>
393 instead.</para></listitem>
397 <term><command>show-seat</command> <replaceable>NAME</replaceable>...</term>
399 <listitem><para>Show properties of one
400 or more seats or the manager
401 itself. If no argument is specified,
402 properties of the manager will be
403 shown. If a seat is specified,
404 properties of the seat are shown. By
405 default, empty properties are
406 suppressed. Use <option>--all</option>
407 to show those too. To select specific
408 properties to show, use
409 <option>--property=</option>. This
410 command is intended to be used
411 whenever computer-parsable output is
413 <command>seat-status</command> if you
414 are looking for formatted
416 output.</para></listitem>
420 <term><command>attach</command> <replaceable>NAME</replaceable> <replaceable>DEVICE</replaceable>...</term>
422 <listitem><para>Persistently attach
423 one or more devices to a seat. The
424 devices should be specified via device
425 paths in the <filename>/sys</filename>
426 file system. To create a new seat,
427 attach at least one graphics card to a
428 previously unused seat name. Seat
429 names may consist only of a-z, A-Z,
430 0-9, <literal>-</literal> and
431 <literal>_</literal> and must be
432 prefixed with <literal>seat</literal>.
433 To drop assignment of a device to a
434 specific seat, just reassign it to a
435 different seat, or use
436 <command>flush-devices</command>.
441 <term><command>flush-devices</command></term>
443 <listitem><para>Removes all device
444 assignments previously created with
445 <command>attach</command>. After this
446 call, only automatically generated
447 seats will remain, and all seat
448 hardware is assigned to
449 them.</para></listitem>
453 <term><command>terminate-seat</command> <replaceable>NAME</replaceable>...</term>
455 <listitem><para>Terminates all
456 sessions on a seat. This kills all
457 processes of all sessions on the seat
458 and deallocates all runtime resources
459 attached to them.</para></listitem>
466 <title>Exit status</title>
468 <para>On success, 0 is returned, a non-zero failure
469 code otherwise.</para>
472 <xi:include href="less-variables.xml" />
475 <title>See Also</title>
477 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
478 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
479 <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
480 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>