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 elogind.
8 Copyright 2010 Lennart Poettering
10 elogind 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 elogind 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 elogind; If not, see <http://www.gnu.org/licenses/>.
24 <refentry id="loginctl" xmlns:xi="http://www.w3.org/2001/XInclude">
27 <title>loginctl</title>
28 <productname>elogind</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 elogind login manager</refpurpose>
52 <command>loginctl</command>
53 <arg choice="opt" rep="repeat">OPTIONS</arg>
54 <arg choice="req">COMMAND</arg>
55 <arg choice="opt" rep="repeat">NAME</arg>
60 <title>Description</title>
62 <para><command>loginctl</command> may be used to introspect and
63 control the state of the
64 <citerefentry><refentrytitle>elogind</refentrytitle><manvolnum>1</manvolnum></citerefentry>
69 <title>Options</title>
71 <para>The following options are understood:</para>
75 <term><option>--no-ask-password</option></term>
77 <listitem><para>Do not query the user for authentication for
78 privileged operations.</para></listitem>
82 <term><option>-p</option></term>
83 <term><option>--property=</option></term>
85 <listitem><para>When showing session/user/seat properties,
86 limit display to certain properties as specified as argument.
87 If not specified, all set properties are shown. The argument
88 should be a property name, such as
89 <literal>Sessions</literal>. If specified more than once, all
90 properties with the specified names are
91 shown.</para></listitem>
95 <term><option>-a</option></term>
96 <term><option>--all</option></term>
98 <listitem><para>When showing session/user/seat properties,
99 show all properties regardless of whether they are set or
100 not.</para></listitem>
104 <term><option>-l</option></term>
105 <term><option>--full</option></term>
107 <listitem><para>Do not ellipsize process tree entries.</para>
112 <term><option>--kill-who=</option></term>
114 <listitem><para>When used with
115 <command>kill-session</command>, choose which processes to
116 kill. Must be one of <option>leader</option>, or
117 <option>all</option> to select whether to kill only the leader
118 process of the session or all processes of the session. If
119 omitted, defaults to <option>all</option>.</para></listitem>
123 <term><option>-s</option></term>
124 <term><option>--signal=</option></term>
126 <listitem><para>When used with <command>kill-session</command>
127 or <command>kill-user</command>, choose which signal to send
128 to selected processes. Must be one of the well known signal
129 specifiers, such as <constant>SIGTERM</constant>,
130 <constant>SIGINT</constant> or <constant>SIGSTOP</constant>.
131 If omitted, defaults to
132 <constant>SIGTERM</constant>.</para></listitem>
136 <term><option>-n</option></term>
137 <term><option>--lines=</option></term>
139 <listitem><para>When used with <command>user-status</command>
140 and <command>session-status</command>, controls the number of
141 journal lines to show, counting from the most recent ones.
142 Takes a positive integer argument. Defaults to 10.</para>
147 <term><option>-o</option></term>
148 <term><option>--output=</option></term>
150 <listitem><para>When used with <command>user-status</command>
151 and <command>session-status</command>, controls the formatting
152 of the journal entries that are shown. For the available
154 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
155 Defaults to <literal>short</literal>.</para></listitem>
158 <xi:include href="user-system-options.xml" xpointer="host" />
159 <xi:include href="user-system-options.xml" xpointer="machine" />
161 <xi:include href="standard-options.xml" xpointer="no-pager" />
162 <xi:include href="standard-options.xml" xpointer="no-legend" />
163 <xi:include href="standard-options.xml" xpointer="help" />
164 <xi:include href="standard-options.xml" xpointer="version" />
169 <title>Commands</title>
171 <para>The following commands are understood:</para>
173 <refsect2><title>Session Commands</title><variablelist>
176 <term><command>list-sessions</command></term>
178 <listitem><para>List current sessions.</para></listitem>
182 <term><command>session-status</command> <optional><replaceable>ID</replaceable>...</optional></term>
184 <listitem><para>Show terse runtime status information about
185 one or more sessions, followed by the most recent log data
186 from the journal. Takes one or more session identifiers as
187 parameters. If no session identifiers are passed the status of
188 the caller's session is shown. This function is intended to
189 generate human-readable output. If you are looking for
190 computer-parsable output, use <command>show-session</command>
191 instead.</para></listitem>
195 <term><command>show-session</command> <optional><replaceable>ID</replaceable>...</optional></term>
197 <listitem><para>Show properties of one or more sessions or the
198 manager itself. If no argument is specified, properties of the
199 manager will be shown. If a session ID is specified,
200 properties of the session are shown. By default, empty
201 properties are suppressed. Use <option>--all</option> to show
202 those too. To select specific properties to show, use
203 <option>--property=</option>. This command is intended to be
204 used whenever computer-parsable output is required. Use
205 <command>session-status</command> if you are looking for
206 formatted human-readable output.</para></listitem>
210 <term><command>activate</command> <optional><replaceable>ID</replaceable></optional></term>
212 <listitem><para>Activate a session. This brings a session into
213 the foreground, if another session is currently in the
214 foreground on the respective seat. Takes a session identifier
215 as argument. If no argument is specified the session of the
216 caller is put into foreground.</para></listitem>
220 <term><command>lock-session</command> <optional><replaceable>ID</replaceable>...</optional></term>
221 <term><command>unlock-session</command> <optional><replaceable>ID</replaceable>...</optional></term>
223 <listitem><para>Activates/deactivates the screen lock on one
224 or more sessions, if the session supports it. Takes one or
225 more session identifiers as arguments. If no argument is
226 specified the session of the caller is locked/unlocked.
231 <term><command>lock-sessions</command></term>
232 <term><command>unlock-sessions</command></term>
234 <listitem><para>Activates/deactivates the screen lock on all
235 current sessions supporting it. </para></listitem>
239 <term><command>terminate-session</command> <replaceable>ID</replaceable>...</term>
241 <listitem><para>Terminates a session. This kills all processes
242 of the session and deallocates all resources attached to the
243 session. </para></listitem>
247 <term><command>kill-session</command> <replaceable>ID</replaceable>...</term>
249 <listitem><para>Send a signal to one or more processes of the
250 session. Use <option>--kill-who=</option> to select which
251 process to kill. Use <option>--signal=</option> to select the
252 signal to send.</para></listitem>
254 </variablelist></refsect2>
256 <refsect2><title>User Commands</title><variablelist>
258 <term><command>list-users</command></term>
260 <listitem><para>List currently logged in users.
265 <term><command>user-status</command> <optional><replaceable>USER</replaceable>...</optional></term>
267 <listitem><para>Show terse runtime status information about
268 one or more logged in users, followed by the most recent log
269 data from the journal. Takes one or more user names or numeric
270 user IDs as parameters. If no parameters are passed the status
271 of the caller's user is shown. This function is intended to
272 generate human-readable output. If you are looking for
273 computer-parsable output, use <command>show-user</command>
274 instead. Users may be specified by their usernames or numeric
275 user IDs. </para></listitem>
279 <term><command>show-user</command> <optional><replaceable>USER</replaceable>...</optional></term>
281 <listitem><para>Show properties of one or more users or the
282 manager itself. If no argument is specified, properties of the
283 manager will be shown. If a user is specified, properties of
284 the user are shown. By default, empty properties are
285 suppressed. Use <option>--all</option> to show those too. To
286 select specific properties to show, use
287 <option>--property=</option>. This command is intended to be
288 used whenever computer-parsable output is required. Use
289 <command>user-status</command> if you are looking for
290 formatted human-readable output.</para></listitem>
294 <term><command>enable-linger</command> <optional><replaceable>USER</replaceable>...</optional></term>
295 <term><command>disable-linger</command> <optional><replaceable>USER</replaceable>...</optional></term>
297 <listitem><para>Enable/disable user lingering for one or more
298 users. If enabled for a specific user, a user manager is
299 spawned for the user at boot and kept around after logouts.
300 This allows users who are not logged in to run long-running
301 services. Takes one or more user names or numeric UIDs as
302 argument. If no argument is specified enables/disables
303 lingering for the user of the session of the caller.
308 <term><command>terminate-user</command> <replaceable>USER</replaceable>...</term>
310 <listitem><para>Terminates all sessions of a user. This kills
311 all processes of all sessions of the user and deallocates all
312 runtime resources attached to the user.</para></listitem>
316 <term><command>kill-user</command> <replaceable>USER</replaceable>...</term>
318 <listitem><para>Send a signal to all processes of a user. Use
319 <option>--signal=</option> to select the signal to send.
322 </variablelist></refsect2>
324 <refsect2><title>Seat Commands</title><variablelist>
326 <term><command>list-seats</command></term>
328 <listitem><para>List currently available seats on the local
329 system.</para></listitem>
333 <term><command>seat-status</command> <optional><replaceable>NAME</replaceable>...</optional></term>
335 <listitem><para>Show terse runtime status information about
336 one or more seats. Takes one or more seat names as parameters.
337 If no seat names are passed the status of the caller's
338 session's seat is shown. This function is intended to generate
339 human-readable output. If you are looking for
340 computer-parsable output, use <command>show-seat</command>
341 instead.</para></listitem>
345 <term><command>show-seat</command> <optional><replaceable>NAME</replaceable>...</optional></term>
347 <listitem><para>Show properties of one or more seats or the
348 manager itself. If no argument is specified, properties of the
349 manager will be shown. If a seat is specified, properties of
350 the seat are shown. By default, empty properties are
351 suppressed. Use <option>--all</option> to show those too. To
352 select specific properties to show, use
353 <option>--property=</option>. This command is intended to be
354 used whenever computer-parsable output is required. Use
355 <command>seat-status</command> if you are looking for
356 formatted human-readable output.</para></listitem>
360 <term><command>attach</command> <replaceable>NAME</replaceable> <replaceable>DEVICE</replaceable>...</term>
362 <listitem><para>Persistently attach one or more devices to a
363 seat. The devices should be specified via device paths in the
364 <filename>/sys</filename> file system. To create a new seat,
365 attach at least one graphics card to a previously unused seat
366 name. Seat names may consist only of a-z, A-Z, 0-9,
367 <literal>-</literal> and <literal>_</literal> and must be
368 prefixed with <literal>seat</literal>. To drop assignment of a
369 device to a specific seat, just reassign it to a different
370 seat, or use <command>flush-devices</command>.
375 <term><command>flush-devices</command></term>
377 <listitem><para>Removes all device assignments previously
378 created with <command>attach</command>. After this call, only
379 automatically generated seats will remain, and all seat
380 hardware is assigned to them.</para></listitem>
384 <term><command>terminate-seat</command> <replaceable>NAME</replaceable>...</term>
386 <listitem><para>Terminates all sessions on a seat. This kills
387 all processes of all sessions on the seat and deallocates all
388 runtime resources attached to them.</para></listitem>
390 </variablelist></refsect2>
395 <title>Exit status</title>
397 <para>On success, 0 is returned, a non-zero failure code
401 <xi:include href="less-variables.xml" />
404 <title>See Also</title>
406 <citerefentry><refentrytitle>elogind</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
407 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
408 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>