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" [
4 <!ENTITY % entities SYSTEM "custom-entities.ent" >
9 This file is part of systemd.
11 Copyright 2010 Lennart Poettering
13 systemd is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
16 (at your option) any later version.
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
23 You should have received a copy of the GNU Lesser General Public License
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
27 <refentry id="loginctl" xmlns:xi="http://www.w3.org/2001/XInclude">
30 <title>loginctl</title>
31 <productname>systemd</productname>
35 <contrib>Developer</contrib>
36 <firstname>Lennart</firstname>
37 <surname>Poettering</surname>
38 <email>lennart@poettering.net</email>
44 <refentrytitle>loginctl</refentrytitle>
45 <manvolnum>1</manvolnum>
49 <refname>loginctl</refname>
50 <refpurpose>Control the systemd login manager</refpurpose>
55 <command>loginctl</command>
56 <arg choice="opt" rep="repeat">OPTIONS</arg>
57 <arg choice="req">COMMAND</arg>
58 <arg choice="opt" rep="repeat">NAME</arg>
63 <title>Description</title>
65 <para><command>loginctl</command> may be used to introspect and
66 control the state of the
67 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
69 <citerefentry><refentrytitle>logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
73 <title>Options</title>
75 <para>The following options are understood:</para>
79 <term><option>--no-ask-password</option></term>
81 <listitem><para>Do not query the user for authentication for
82 privileged operations.</para></listitem>
86 <term><option>-p</option></term>
87 <term><option>--property=</option></term>
89 <listitem><para>When showing session/user/seat properties,
90 limit display to certain properties as specified as argument.
91 If not specified, all set properties are shown. The argument
92 should be a property name, such as
93 <literal>Sessions</literal>. If specified more than once, all
94 properties with the specified names are
95 shown.</para></listitem>
99 <term><option>-a</option></term>
100 <term><option>--all</option></term>
102 <listitem><para>When showing session/user/seat properties,
103 show all properties regardless of whether they are set or
104 not.</para></listitem>
108 <term><option>-l</option></term>
109 <term><option>--full</option></term>
111 <listitem><para>Do not ellipsize process tree entries.</para>
116 <term><option>--kill-who=</option></term>
118 <listitem><para>When used with
119 <command>kill-session</command>, choose which processes to
120 kill. Must be one of <option>leader</option>, or
121 <option>all</option> to select whether to kill only the leader
122 process of the session or all processes of the session. If
123 omitted, defaults to <option>all</option>.</para></listitem>
127 <term><option>-s</option></term>
128 <term><option>--signal=</option></term>
130 <listitem><para>When used with <command>kill-session</command>
131 or <command>kill-user</command>, choose which signal to send
132 to selected processes. Must be one of the well known signal
133 specifiers, such as <constant>SIGTERM</constant>,
134 <constant>SIGINT</constant> or <constant>SIGSTOP</constant>.
135 If omitted, defaults to
136 <constant>SIGTERM</constant>.</para></listitem>
140 <term><option>-n</option></term>
141 <term><option>--lines=</option></term>
143 <listitem><para>When used with <command>user-status</command>
144 and <command>session-status</command>, controls the number of
145 journal lines to show, counting from the most recent ones.
146 Takes a positive integer argument. Defaults to 10.</para>
151 <term><option>-o</option></term>
152 <term><option>--output=</option></term>
154 <listitem><para>When used with <command>user-status</command>
155 and <command>session-status</command>, controls the formatting
156 of the journal entries that are shown. For the available
158 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
159 Defaults to <literal>short</literal>.</para></listitem>
162 <xi:include href="user-system-options.xml" xpointer="host" />
163 <xi:include href="user-system-options.xml" xpointer="machine" />
165 <xi:include href="standard-options.xml" xpointer="no-pager" />
166 <xi:include href="standard-options.xml" xpointer="no-legend" />
167 <xi:include href="standard-options.xml" xpointer="help" />
168 <xi:include href="standard-options.xml" xpointer="version" />
173 <title>Commands</title>
175 <para>The following commands are understood:</para>
177 <refsect2><title>Session Commands</title><variablelist>
180 <term><command>list-sessions</command></term>
182 <listitem><para>List current sessions.</para></listitem>
186 <term><command>session-status</command> <optional><replaceable>ID</replaceable>...</optional></term>
188 <listitem><para>Show terse runtime status information about
189 one or more sessions, followed by the most recent log data
190 from the journal. Takes one or more session identifiers as
191 parameters. If no session identifiers are passed the status of
192 the caller's session is shown. This function is intended to
193 generate human-readable output. If you are looking for
194 computer-parsable output, use <command>show-session</command>
195 instead.</para></listitem>
199 <term><command>show-session</command> <optional><replaceable>ID</replaceable>...</optional></term>
201 <listitem><para>Show properties of one or more sessions or the
202 manager itself. If no argument is specified, properties of the
203 manager will be shown. If a session ID is specified,
204 properties of the session are shown. By default, empty
205 properties are suppressed. Use <option>--all</option> to show
206 those too. To select specific properties to show, use
207 <option>--property=</option>. This command is intended to be
208 used whenever computer-parsable output is required. Use
209 <command>session-status</command> if you are looking for
210 formatted human-readable output.</para></listitem>
214 <term><command>activate</command> <optional><replaceable>ID</replaceable></optional></term>
216 <listitem><para>Activate a session. This brings a session into
217 the foreground, if another session is currently in the
218 foreground on the respective seat. Takes a session identifier
219 as argument. If no argument is specified the session of the
220 caller is put into foreground.</para></listitem>
224 <term><command>lock-session</command> <optional><replaceable>ID</replaceable>...</optional></term>
225 <term><command>unlock-session</command> <optional><replaceable>ID</replaceable>...</optional></term>
227 <listitem><para>Activates/deactivates the screen lock on one
228 or more sessions, if the session supports it. Takes one or
229 more session identifiers as arguments. If no argument is
230 specified the session of the caller is locked/unlocked.
235 <term><command>lock-sessions</command></term>
236 <term><command>unlock-sessions</command></term>
238 <listitem><para>Activates/deactivates the screen lock on all
239 current sessions supporting it. </para></listitem>
243 <term><command>terminate-session</command> <replaceable>ID</replaceable>...</term>
245 <listitem><para>Terminates a session. This kills all processes
246 of the session and deallocates all resources attached to the
247 session. </para></listitem>
251 <term><command>kill-session</command> <replaceable>ID</replaceable>...</term>
253 <listitem><para>Send a signal to one or more processes of the
254 session. Use <option>--kill-who=</option> to select which
255 process to kill. Use <option>--signal=</option> to select the
256 signal to send.</para></listitem>
258 </variablelist></refsect2>
260 <refsect2><title>User Commands</title><variablelist>
262 <term><command>list-users</command></term>
264 <listitem><para>List currently logged in users.
269 <term><command>user-status</command> <optional><replaceable>USER</replaceable>...</optional></term>
271 <listitem><para>Show terse runtime status information about
272 one or more logged in users, followed by the most recent log
273 data from the journal. Takes one or more user names or numeric
274 user IDs as parameters. If no parameters are passed the status
275 of the caller's user is shown. This function is intended to
276 generate human-readable output. If you are looking for
277 computer-parsable output, use <command>show-user</command>
278 instead. Users may be specified by their usernames or numeric
279 user IDs. </para></listitem>
283 <term><command>show-user</command> <optional><replaceable>USER</replaceable>...</optional></term>
285 <listitem><para>Show properties of one or more users or the
286 manager itself. If no argument is specified, properties of the
287 manager will be shown. If a user is specified, properties of
288 the user are shown. By default, empty properties are
289 suppressed. Use <option>--all</option> to show those too. To
290 select specific properties to show, use
291 <option>--property=</option>. This command is intended to be
292 used whenever computer-parsable output is required. Use
293 <command>user-status</command> if you are looking for
294 formatted human-readable output.</para></listitem>
298 <term><command>enable-linger</command> <optional><replaceable>USER</replaceable>...</optional></term>
299 <term><command>disable-linger</command> <optional><replaceable>USER</replaceable>...</optional></term>
301 <listitem><para>Enable/disable user lingering for one or more
302 users. If enabled for a specific user, a user manager is
303 spawned for the user at boot and kept around after logouts.
304 This allows users who are not logged in to run long-running
305 services. Takes one or more user names or numeric UIDs as
306 argument. If no argument is specified enables/disables
307 lingering for the user of the session of the caller.
312 <term><command>terminate-user</command> <replaceable>USER</replaceable>...</term>
314 <listitem><para>Terminates all sessions of a user. This kills
315 all processes of all sessions of the user and deallocates all
316 runtime resources attached to the user.</para></listitem>
320 <term><command>kill-user</command> <replaceable>USER</replaceable>...</term>
322 <listitem><para>Send a signal to all processes of a user. Use
323 <option>--signal=</option> to select the signal to send.
326 </variablelist></refsect2>
328 <refsect2><title>Seat Commands</title><variablelist>
330 <term><command>list-seats</command></term>
332 <listitem><para>List currently available seats on the local
333 system.</para></listitem>
337 <term><command>seat-status</command> <optional><replaceable>NAME</replaceable>...</optional></term>
339 <listitem><para>Show terse runtime status information about
340 one or more seats. Takes one or more seat names as parameters.
341 If no seat names are passed the status of the caller's
342 session's seat is shown. This function is intended to generate
343 human-readable output. If you are looking for
344 computer-parsable output, use <command>show-seat</command>
345 instead.</para></listitem>
349 <term><command>show-seat</command> <optional><replaceable>NAME</replaceable>...</optional></term>
351 <listitem><para>Show properties of one or more seats or the
352 manager itself. If no argument is specified, properties of the
353 manager will be shown. If a seat is specified, properties of
354 the seat are shown. By default, empty properties are
355 suppressed. Use <option>--all</option> to show those too. To
356 select specific properties to show, use
357 <option>--property=</option>. This command is intended to be
358 used whenever computer-parsable output is required. Use
359 <command>seat-status</command> if you are looking for
360 formatted human-readable output.</para></listitem>
364 <term><command>attach</command> <replaceable>NAME</replaceable> <replaceable>DEVICE</replaceable>...</term>
366 <listitem><para>Persistently attach one or more devices to a
367 seat. The devices should be specified via device paths in the
368 <filename>/sys</filename> file system. To create a new seat,
369 attach at least one graphics card to a previously unused seat
370 name. Seat names may consist only of a-z, A-Z, 0-9,
371 <literal>-</literal> and <literal>_</literal> and must be
372 prefixed with <literal>seat</literal>. To drop assignment of a
373 device to a specific seat, just reassign it to a different
374 seat, or use <command>flush-devices</command>.
379 <term><command>flush-devices</command></term>
381 <listitem><para>Removes all device assignments previously
382 created with <command>attach</command>. After this call, only
383 automatically generated seats will remain, and all seat
384 hardware is assigned to them.</para></listitem>
388 <term><command>terminate-seat</command> <replaceable>NAME</replaceable>...</term>
390 <listitem><para>Terminates all sessions on a seat. This kills
391 all processes of all sessions on the seat and deallocates all
392 runtime resources attached to them.</para></listitem>
394 </variablelist></refsect2>
399 <title>Exit status</title>
401 <para>On success, 0 is returned, a non-zero failure code
405 <xi:include href="less-variables.xml" />
408 <title>See Also</title>
410 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
411 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
412 <citerefentry><refentrytitle>logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
413 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>