]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/logind.conf.xml
verify: use manager_load_startable_unit_or_warn() to load units for verification
[thirdparty/systemd.git] / man / logind.conf.xml
CommitLineData
90558f31 1<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
8fa365e5 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
c7f7e859
MK
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4<!ENTITY % entities SYSTEM "custom-entities.ent" >
5%entities;
6]>
8fa365e5
LP
7
8<!--
572eb058
ZJS
9 SPDX-License-Identifier: LGPL-2.1+
10
8fa365e5
LP
11 This file is part of systemd.
12
13 Copyright 2010 Lennart Poettering
14
15 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
16 under the terms of the GNU Lesser General Public License as published by
17 the Free Software Foundation; either version 2.1 of the License, or
8fa365e5
LP
18 (at your option) any later version.
19
20 systemd is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 23 Lesser General Public License for more details.
8fa365e5 24
5430f7f2 25 You should have received a copy of the GNU Lesser General Public License
8fa365e5
LP
26 along with systemd; If not, see <http://www.gnu.org/licenses/>.
27-->
28
d3fae78f 29<refentry id="logind.conf" conditional='ENABLE_LOGIND'
798d3a52
ZJS
30 xmlns:xi="http://www.w3.org/2001/XInclude">
31 <refentryinfo>
32 <title>logind.conf</title>
33 <productname>systemd</productname>
34
35 <authorgroup>
36 <author>
37 <contrib>Developer</contrib>
38 <firstname>Lennart</firstname>
39 <surname>Poettering</surname>
40 <email>lennart@poettering.net</email>
41 </author>
42 </authorgroup>
43 </refentryinfo>
44
45 <refmeta>
46 <refentrytitle>logind.conf</refentrytitle>
47 <manvolnum>5</manvolnum>
48 </refmeta>
49
50 <refnamediv>
51 <refname>logind.conf</refname>
52 <refname>logind.conf.d</refname>
53 <refpurpose>Login manager configuration files</refpurpose>
54 </refnamediv>
55
56 <refsynopsisdiv>
12b42c76
TG
57 <para><filename>/etc/systemd/logind.conf</filename></para>
58 <para><filename>/etc/systemd/logind.conf.d/*.conf</filename></para>
798d3a52 59 <para><filename>/run/systemd/logind.conf.d/*.conf</filename></para>
12b42c76 60 <para><filename>/usr/lib/systemd/logind.conf.d/*.conf</filename></para>
798d3a52
ZJS
61 </refsynopsisdiv>
62
63 <refsect1>
64 <title>Description</title>
65
e93549ef
ZJS
66 <para>These files configure various parameters of the systemd
67 login manager,
68 <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
69 </para>
798d3a52
ZJS
70 </refsect1>
71
e93549ef 72 <xi:include href="standard-conf.xml" xpointer="main-conf" />
798d3a52
ZJS
73
74 <refsect1>
75 <title>Options</title>
76
77 <para>All options are configured in the
78 <literal>[Login]</literal> section:</para>
79
80 <variablelist>
81
82 <varlistentry>
83 <term><varname>NAutoVTs=</varname></term>
84
85 <listitem><para>Takes a positive integer. Configures how many
86 virtual terminals (VTs) to allocate by default that, when
87 switched to and are previously unused,
88 <literal>autovt</literal> services are automatically spawned
89 on. These services are instantiated from the template unit
90 <filename>autovt@.service</filename> for the respective VT TTY
91 name, for example, <filename>autovt@tty4.service</filename>.
92 By default, <filename>autovt@.service</filename> is linked to
93 <filename>getty@.service</filename>. In other words, login
94 prompts are started dynamically as the user switches to unused
95 virtual terminals. Hence, this parameter controls how many
96 login <literal>gettys</literal> are available on the VTs. If a
97 VT is already used by some other subsystem (for example, a
98 graphical login), this kind of activation will not be
99 attempted. Note that the VT configured in
100 <varname>ReserveVT=</varname> is always subject to this kind
101 of activation, even if it is not one of the VTs configured
102 with the <varname>NAutoVTs=</varname> directive. Defaults to
103 6. When set to 0, automatic spawning of
104 <literal>autovt</literal> services is
105 disabled.</para></listitem>
106 </varlistentry>
107
108 <varlistentry>
109 <term><varname>ReserveVT=</varname></term>
110
111 <listitem><para>Takes a positive integer. Identifies one
112 virtual terminal that shall unconditionally be reserved for
113 <filename>autovt@.service</filename> activation (see above).
114 The VT selected with this option will be marked busy
115 unconditionally, so that no other subsystem will allocate it.
116 This functionality is useful to ensure that, regardless of how
117 many VTs are allocated by other subsystems, one login
118 <literal>getty</literal> is always available. Defaults to 6
119 (in other words, there will always be a
120 <literal>getty</literal> available on Alt-F6.). When set to 0,
121 VT reservation is disabled.</para></listitem>
122 </varlistentry>
123
124 <varlistentry>
125 <term><varname>KillUserProcesses=</varname></term>
126
65eb37f8
ZJS
127 <listitem><para>Takes a boolean argument. Configures whether the processes of a
128 user should be killed when the user logs out. If true, the scope unit
129 corresponding to the session and all processes inside that scope will be
4f25723c 130 terminated. If false, the scope is "abandoned", see
65eb37f8 131 <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
c7f7e859 132 and processes are not killed. Defaults to <literal>&KILL_USER_PROCESSES;</literal>,
921f831d
ZJS
133 but see the options <varname>KillOnlyUsers=</varname> and
134 <varname>KillExcludeUsers=</varname> below.</para>
65eb37f8
ZJS
135
136 <para>In addition to session processes, user process may run under the user
137 manager unit <filename>user@.service</filename>. Depending on the linger
138 settings, this may allow users to run processes independent of their login
139 sessions. See the description of <command>enable-linger</command> in
140 <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
141 </para>
142
143 <para>Note that setting <varname>KillUserProcesses=yes</varname>
798d3a52 144 will break tools like
65eb37f8
ZJS
145 <citerefentry project='die-net'><refentrytitle>screen</refentrytitle><manvolnum>1</manvolnum></citerefentry>
146 and
147 <citerefentry project='die-net'><refentrytitle>tmux</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
148 unless they are moved out of the session scope. See example in
149 <citerefentry><refentrytitle>systemd-run</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
150 </para></listitem>
798d3a52
ZJS
151 </varlistentry>
152
153 <varlistentry>
154 <term><varname>KillOnlyUsers=</varname></term>
155 <term><varname>KillExcludeUsers=</varname></term>
156
921f831d
ZJS
157 <listitem><para>These settings take space-separated lists of usernames that override
158 the <varname>KillUserProcesses=</varname> setting. A user name may be added to
159 <varname>KillExcludeUsers=</varname> to exclude the processes in the session scopes of
160 that user from being killed even if <varname>KillUserProcesses=yes</varname> is set. If
161 <varname>KillExcludeUsers=</varname> is not set, the <literal>root</literal> user is
162 excluded by default. <varname>KillExcludeUsers=</varname> may be set to an empty value
163 to override this default. If a user is not excluded, <varname>KillOnlyUsers=</varname>
164 is checked next. If this setting is specified, only the session scopes of those users
165 will be killed. Otherwise, users are subject to the
166 <varname>KillUserProcesses=yes</varname> setting.</para></listitem>
798d3a52
ZJS
167 </varlistentry>
168
169 <varlistentry>
170 <term><varname>IdleAction=</varname></term>
171
172 <listitem><para>Configures the action to take when the system
173 is idle. Takes one of
174 <literal>ignore</literal>,
175 <literal>poweroff</literal>,
176 <literal>reboot</literal>,
177 <literal>halt</literal>,
178 <literal>kexec</literal>,
179 <literal>suspend</literal>,
180 <literal>hibernate</literal>,
c58493c0 181 <literal>hybrid-sleep</literal>,
e68c79db 182 <literal>suspend-then-hibernate</literal>, and
798d3a52
ZJS
183 <literal>lock</literal>.
184 Defaults to <literal>ignore</literal>.</para>
185
186 <para>Note that this requires that user sessions correctly
187 report the idle status to the system. The system will execute
188 the action after all sessions report that they are idle, no
189 idle inhibitor lock is active, and subsequently, the time
190 configured with <varname>IdleActionSec=</varname> (see below)
191 has expired.</para>
192 </listitem>
193 </varlistentry>
194
195 <varlistentry>
196 <term><varname>IdleActionSec=</varname></term>
197
198 <listitem><para>Configures the delay after which the action
199 configured in <varname>IdleAction=</varname> (see above) is
200 taken after the system is idle.</para></listitem>
201 </varlistentry>
202
203 <varlistentry>
204 <term><varname>InhibitDelayMaxSec=</varname></term>
205
206 <listitem><para>Specifies the maximum time a system shutdown
207 or sleep request is delayed due to an inhibitor lock of type
208 <literal>delay</literal> being active before the inhibitor is
209 ignored and the operation executes anyway. Defaults to
210 5.</para></listitem>
211 </varlistentry>
212
213 <varlistentry>
214 <term><varname>HandlePowerKey=</varname></term>
215 <term><varname>HandleSuspendKey=</varname></term>
216 <term><varname>HandleHibernateKey=</varname></term>
217 <term><varname>HandleLidSwitch=</varname></term>
e25937a3 218 <term><varname>HandleLidSwitchExternalPower=</varname></term>
798d3a52
ZJS
219 <term><varname>HandleLidSwitchDocked=</varname></term>
220
05b2a8fd 221 <listitem><para>Controls how logind shall handle the
798d3a52
ZJS
222 system power and sleep keys and the lid switch to trigger
223 actions such as system power-off or suspend. Can be one of
224 <literal>ignore</literal>,
225 <literal>poweroff</literal>,
226 <literal>reboot</literal>,
227 <literal>halt</literal>,
228 <literal>kexec</literal>,
229 <literal>suspend</literal>,
230 <literal>hibernate</literal>,
c58493c0 231 <literal>hybrid-sleep</literal>,
e68c79db 232 <literal>suspend-then-hibernate</literal>, and
798d3a52
ZJS
233 <literal>lock</literal>.
234 If <literal>ignore</literal>, logind will never handle these
235 keys. If <literal>lock</literal>, all running sessions will be
236 screen-locked; otherwise, the specified action will be taken
237 in the respective event. Only input devices with the
238 <literal>power-switch</literal> udev tag will be watched for
239 key/lid switch events. <varname>HandlePowerKey=</varname>
240 defaults to <literal>poweroff</literal>.
241 <varname>HandleSuspendKey=</varname> and
242 <varname>HandleLidSwitch=</varname> default to
243 <literal>suspend</literal>.
e25937a3 244 <varname>HandleLidSwitchExternalPower=</varname> is completely
c8fad2e7 245 ignored by default (for backwards compatibility) — an explicit
e25937a3 246 value must be set before it will be used to determine
c8fad2e7 247 behaviour. <varname>HandleLidSwitchDocked=</varname> defaults
e25937a3 248 to <literal>ignore</literal>.
798d3a52
ZJS
249 <varname>HandleHibernateKey=</varname> defaults to
250 <literal>hibernate</literal>. If the system is inserted in a
251 docking station, or if more than one display is connected, the
252 action specified by <varname>HandleLidSwitchDocked=</varname>
e25937a3
SF
253 occurs; if the system is on external power the action (if any)
254 specified by <varname>HandleLidSwitchExternalPower=</varname>
798d3a52 255 occurs; otherwise the <varname>HandleLidSwitch=</varname>
05b2a8fd
ZJS
256 action occurs.</para>
257
258 <para>A different application may disable logind's handling of system power and
259 sleep keys and the lid switch by taking a low-level inhibitor lock
3daffa82
MB
260 (<literal>handle-power-key</literal>, <literal>handle-suspend-key</literal>,
261 <literal>handle-hibernate-key</literal>, <literal>handle-lid-switch</literal>).
262 This is most commonly used by graphical desktop environments
05b2a8fd
ZJS
263 to take over suspend and hibernation handling, and to use their own configuration
264 mechanisms. If a low-level inhibitor lock is taken, logind will not take any
265 action when that key or switch is triggered and the <varname>Handle*=</varname>
266 settings are irrelevant.</para></listitem>
798d3a52
ZJS
267 </varlistentry>
268
269 <varlistentry>
270 <term><varname>PowerKeyIgnoreInhibited=</varname></term>
271 <term><varname>SuspendKeyIgnoreInhibited=</varname></term>
272 <term><varname>HibernateKeyIgnoreInhibited=</varname></term>
273 <term><varname>LidSwitchIgnoreInhibited=</varname></term>
274
05b2a8fd
ZJS
275 <listitem><para>Controls whether actions that <command>systemd-logind</command>
276 takes when the power and sleep keys and the lid switch are triggered are subject
277 to high-level inhibitor locks ("shutdown", "sleep", "idle"). Low level inhibitor
3daffa82
MB
278 locks (<literal>handle-power-key</literal>, <literal>handle-suspend-key</literal>,
279 <literal>handle-hibernate-key</literal>, <literal>handle-lid-switch</literal>),
280 are always honored, irrespective of this setting.</para>
05b2a8fd
ZJS
281
282 <para>These settings take boolean arguments. If <literal>no</literal>, the
283 inhibitor locks taken by applications are respected. If <literal>yes</literal>,
284 "shutdown", "sleep", and "idle" inhibitor locks are ignored.
798d3a52 285 <varname>PowerKeyIgnoreInhibited=</varname>,
05b2a8fd
ZJS
286 <varname>SuspendKeyIgnoreInhibited=</varname>, and
287 <varname>HibernateKeyIgnoreInhibited=</varname> default to <literal>no</literal>.
288 <varname>LidSwitchIgnoreInhibited=</varname> defaults to <literal>yes</literal>.
289 This means that when <command>systemd-logind</command> is handling events by
290 itself (no low level inhibitor locks are taken by another application), the lid
291 switch does not respect suspend blockers by default, but the power and sleep keys
292 do.</para></listitem>
798d3a52
ZJS
293 </varlistentry>
294
9d10cbee
DH
295 <varlistentry>
296 <term><varname>HoldoffTimeoutSec=</varname></term>
297
298 <listitem><para>Specifies the timeout after system startup or
299 system resume in which systemd will hold off on reacting to
a8eaaee7
JE
300 lid events. This is required for the system to properly
301 detect any hotplugged devices so systemd can ignore lid events
9d10cbee
DH
302 if external monitors, or docks, are connected. If set to 0,
303 systemd will always react immediately, possibly before the
304 kernel fully probed all hotplugged devices. This is safe, as
305 long as you do not care for systemd to account for devices
306 that have been plugged or unplugged while the system was off.
307 Defaults to 30s.</para></listitem>
308 </varlistentry>
309
798d3a52
ZJS
310 <varlistentry>
311 <term><varname>RuntimeDirectorySize=</varname></term>
312
313 <listitem><para>Sets the size limit on the
314 <varname>$XDG_RUNTIME_DIR</varname> runtime directory for each
315 user who logs in. Takes a size in bytes, optionally suffixed
316 with the usual K, G, M, and T suffixes, to the base 1024
317 (IEC). Alternatively, a numerical percentage suffixed by
318 <literal>%</literal> may be specified, which sets the size
319 limit relative to the amount of physical RAM. Defaults to 10%.
320 Note that this size is a safety limit only. As each runtime
321 directory is a tmpfs file system, it will only consume as much
90558f31
LP
322 memory as is needed.</para></listitem>
323 </varlistentry>
324
c5a11ae2
LP
325 <varlistentry>
326 <term><varname>InhibitorsMax=</varname></term>
327
328 <listitem><para>Controls the maximum number of concurrent inhibitors to permit. Defaults to 8192
329 (8K).</para></listitem>
330 </varlistentry>
331
183e0738
LP
332 <varlistentry>
333 <term><varname>SessionsMax=</varname></term>
334
335 <listitem><para>Controls the maximum number of concurrent user sessions to manage. Defaults to 8192
336 (8K). Depending on how the <filename>pam_systemd.so</filename> module is included in the PAM stack
337 configuration, further login sessions will either be refused, or permitted but not tracked by
338 <filename>systemd-logind</filename>.</para></listitem>
339 </varlistentry>
340
90558f31
LP
341 <varlistentry>
342 <term><varname>UserTasksMax=</varname></term>
343
c06eec15
LP
344 <listitem><para>Sets the maximum number of OS tasks each user may run concurrently. This controls the
345 <varname>TasksMax=</varname> setting of the per-user slice unit, see
90558f31 346 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
f5058264
TH
347 for details. If assigned the special value <literal>infinity</literal>, no tasks limit is applied.
348 Defaults to 33%, which equals 10813 with the kernel's defaults on the host, but might be smaller in
349 OS containers.</para></listitem>
798d3a52
ZJS
350 </varlistentry>
351
352 <varlistentry>
353 <term><varname>RemoveIPC=</varname></term>
354
f59d94bc
LP
355 <listitem><para>Controls whether System V and POSIX IPC objects belonging to the user shall be removed when the
356 user fully logs out. Takes a boolean argument. If enabled, the user may not consume IPC resources after the
357 last of the user's sessions terminated. This covers System V semaphores, shared memory and message queues, as
358 well as POSIX shared memory and message queues. Note that IPC objects of the root user and other system users
359 are excluded from the effect of this setting. Defaults to <literal>yes</literal>.</para></listitem>
798d3a52
ZJS
360 </varlistentry>
361
362 </variablelist>
363 </refsect1>
364
365 <refsect1>
366 <title>See Also</title>
367 <para>
368 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
369 <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
370 <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
371 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
372 </para>
373 </refsect1>
8fa365e5
LP
374
375</refentry>