1 <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 SPDX-License-Identifier: LGPL-2.1+
8 This file is part of elogind.
10 Copyright 2010 Lennart Poettering
12 elogind is free software; you can redistribute it and/or modify it
13 under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 2.1 of the License, or
15 (at your option) any later version.
17 elogind is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with elogind; If not, see <http://www.gnu.org/licenses/>.
26 <!-- 0 /// elogind does not have to enable itself in configure
27 <refentry id="logind.conf" conditional='ENABLE_LOGIND'
28 xmlns:xi="http://www.w3.org/2001/XInclude">
29 <productname>systemd</productname>
31 <refentry id="logind.conf" xmlns:xi="http://www.w3.org/2001/XInclude">
34 <title>logind.conf</title>
38 <contrib>Developer</contrib>
39 <firstname>Lennart</firstname>
40 <surname>Poettering</surname>
41 <email>lennart@poettering.net</email>
47 <refentrytitle>logind.conf</refentrytitle>
48 <manvolnum>5</manvolnum>
52 <refname>logind.conf</refname>
53 <!-- 0 /// not supported by elogind
54 <refname>logind.conf.d</refname>
56 <refpurpose>Login manager configuration files</refpurpose>
60 <para><filename>/etc/elogind/logind.conf</filename></para>
61 <!-- 0 /// not supported by elogind
62 <para><filename>/etc/systemd/logind.conf.d/*.conf</filename></para>
63 <para><filename>/run/systemd/logind.conf.d/*.conf</filename></para>
64 <para><filename>/usr/lib/systemd/logind.conf.d/*.conf</filename></para>
69 <title>Description</title>
71 <para>These files configure various parameters of the elogind
72 <!-- 0 /// elogind does not need a service file.
74 <citerefentry><refentrytitle>elogind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
81 <!-- 0 /// elogind has only this configuration
82 <xi:include href="standard-conf.xml" xpointer="main-conf" />
86 <title>Options</title>
88 <!-- 0 /// elogind also supports a few system commands
89 <para>All options are configured in the
90 <literal>[Login]</literal> section:</para>
92 <para>All login options are configured in the
93 <literal>[Login]</literal> section, system sleep options are
94 configured in the <literal>[Sleep]</literal> section.</para>
97 <!-- 1 /// elogind needs a second level, as we use two sections. -->
98 <refsect2><title>[Login] section:</title>
102 <!-- 0 /// elogind has no support for AutoVT
105 <term><varname>NAutoVTs=</varname></term>
107 <listitem><para>Takes a positive integer. Configures how many
108 virtual terminals (VTs) to allocate by default that, when
109 switched to and are previously unused,
110 <literal>autovt</literal> services are automatically spawned
111 on. These services are instantiated from the template unit
112 <filename>autovt@.service</filename> for the respective VT TTY
113 name, for example, <filename>autovt@tty4.service</filename>.
114 By default, <filename>autovt@.service</filename> is linked to
115 <filename>getty@.service</filename>. In other words, login
116 prompts are started dynamically as the user switches to unused
117 virtual terminals. Hence, this parameter controls how many
118 login <literal>gettys</literal> are available on the VTs. If a
119 VT is already used by some other subsystem (for example, a
120 graphical login), this kind of activation will not be
121 attempted. Note that the VT configured in
122 <varname>ReserveVT=</varname> is always subject to this kind
123 of activation, even if it is not one of the VTs configured
124 with the <varname>NAutoVTs=</varname> directive. Defaults to
125 6. When set to 0, automatic spawning of
126 <literal>autovt</literal> services is
127 disabled.</para></listitem>
131 <term><varname>ReserveVT=</varname></term>
133 <listitem><para>Takes a positive integer. Identifies one
134 virtual terminal that shall unconditionally be reserved for
135 <filename>autovt@.service</filename> activation (see above).
136 The VT selected with this option will be marked busy
137 unconditionally, so that no other subsystem will allocate it.
138 This functionality is useful to ensure that, regardless of how
139 many VTs are allocated by other subsystems, one login
140 <literal>getty</literal> is always available. Defaults to 6
141 (in other words, there will always be a
142 <literal>getty</literal> available on Alt-F6.). When set to 0,
143 VT reservation is disabled.</para></listitem>
148 <term><varname>KillUserProcesses=</varname></term>
150 <listitem><para>Takes a boolean argument. Configures whether the processes of a
151 <!-- 0 /// elogind has no scope unit, and goes for cgroups only
152 user should be killed when the user logs out. If true, the scope unit
153 corresponding to the session and all processes inside that scope will be
154 terminated. If false, the scope is "abandoned", see
155 <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
157 user should be killed when the user logs out. If true, the processes
158 listed in their session cgroup will be terminated. If false, the session cgroup
161 and processes are not killed. Defaults to <literal>yes</literal>,
162 but see the options <varname>KillOnlyUsers=</varname> and
163 <varname>KillExcludeUsers=</varname> below.</para>
165 <!-- 0 /// elogind has no user manager unit, and lingering isn't clarified, yet.
166 <para>In addition to session processes, user process may run under the user
167 manager unit <filename>user@.service</filename>. Depending on the linger
168 settings, this may allow users to run processes independent of their login
169 sessions. See the description of <command>enable-linger</command> in
170 <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
174 <para>Note that setting <varname>KillUserProcesses=yes</varname>
175 will break tools like
176 <citerefentry project='die-net'><refentrytitle>screen</refentrytitle><manvolnum>1</manvolnum></citerefentry>
178 <citerefentry project='die-net'><refentrytitle>tmux</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
179 <!-- 0 /// elogind does not provide systemd-run or any equivalent, yet.
180 unless they are moved out of the session scope. See example in
181 <citerefentry><refentrytitle>systemd-run</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
183 unless they are moved out of the session scope.
189 <term><varname>KillOnlyUsers=</varname></term>
190 <term><varname>KillExcludeUsers=</varname></term>
192 <listitem><para>These settings take space-separated lists of usernames that override
193 the <varname>KillUserProcesses=</varname> setting. A user name may be added to
194 <varname>KillExcludeUsers=</varname> to exclude the processes in the session scopes of
195 that user from being killed even if <varname>KillUserProcesses=yes</varname> is set. If
196 <varname>KillExcludeUsers=</varname> is not set, the <literal>root</literal> user is
197 excluded by default. <varname>KillExcludeUsers=</varname> may be set to an empty value
198 to override this default. If a user is not excluded, <varname>KillOnlyUsers=</varname>
199 is checked next. If this setting is specified, only the session scopes of those users
200 will be killed. Otherwise, users are subject to the
201 <varname>KillUserProcesses=yes</varname> setting.</para></listitem>
205 <term><varname>IdleAction=</varname></term>
207 <listitem><para>Configures the action to take when the system
208 is idle. Takes one of
209 <literal>ignore</literal>,
210 <literal>poweroff</literal>,
211 <literal>reboot</literal>,
212 <literal>halt</literal>,
213 <literal>kexec</literal>,
214 <literal>suspend</literal>,
215 <literal>hibernate</literal>,
216 <literal>hybrid-sleep</literal>, and
217 <literal>lock</literal>.
218 Defaults to <literal>ignore</literal>.</para>
220 <para>Note that this requires that user sessions correctly
221 report the idle status to the system. The system will execute
222 the action after all sessions report that they are idle, no
223 idle inhibitor lock is active, and subsequently, the time
224 configured with <varname>IdleActionSec=</varname> (see below)
230 <term><varname>IdleActionSec=</varname></term>
232 <listitem><para>Configures the delay after which the action
233 configured in <varname>IdleAction=</varname> (see above) is
234 taken after the system is idle.</para></listitem>
238 <term><varname>InhibitDelayMaxSec=</varname></term>
240 <listitem><para>Specifies the maximum time a system shutdown
241 or sleep request is delayed due to an inhibitor lock of type
242 <literal>delay</literal> being active before the inhibitor is
243 ignored and the operation executes anyway. Defaults to
248 <term><varname>HandlePowerKey=</varname></term>
249 <term><varname>HandleSuspendKey=</varname></term>
250 <term><varname>HandleHibernateKey=</varname></term>
251 <term><varname>HandleLidSwitch=</varname></term>
252 <term><varname>HandleLidSwitchExternalPower=</varname></term>
253 <term><varname>HandleLidSwitchDocked=</varname></term>
255 <listitem><para>Controls how logind shall handle the
256 system power and sleep keys and the lid switch to trigger
257 actions such as system power-off or suspend. Can be one of
258 <literal>ignore</literal>,
259 <literal>poweroff</literal>,
260 <literal>reboot</literal>,
261 <literal>halt</literal>,
262 <literal>kexec</literal>,
263 <literal>suspend</literal>,
264 <literal>hibernate</literal>,
265 <literal>hybrid-sleep</literal>, and
266 <literal>lock</literal>.
267 If <literal>ignore</literal>, logind will never handle these
268 keys. If <literal>lock</literal>, all running sessions will be
269 screen-locked; otherwise, the specified action will be taken
270 in the respective event. Only input devices with the
271 <literal>power-switch</literal> udev tag will be watched for
272 key/lid switch events. <varname>HandlePowerKey=</varname>
273 defaults to <literal>poweroff</literal>.
274 <varname>HandleSuspendKey=</varname> and
275 <varname>HandleLidSwitch=</varname> default to
276 <literal>suspend</literal>.
277 <varname>HandleLidSwitchExternalPower=</varname> is completely
278 ignored by default (for backwards compatibility) — an explicit
279 value must be set before it will be used to determine
280 behaviour. <varname>HandleLidSwitchDocked=</varname> defaults
281 to <literal>ignore</literal>.
282 <varname>HandleHibernateKey=</varname> defaults to
283 <literal>hibernate</literal>. If the system is inserted in a
284 docking station, or if more than one display is connected, the
285 action specified by <varname>HandleLidSwitchDocked=</varname>
286 occurs; if the system is on external power the action (if any)
287 specified by <varname>HandleLidSwitchExternalPower=</varname>
288 occurs; otherwise the <varname>HandleLidSwitch=</varname>
289 action occurs.</para>
291 <para>A different application may disable logind's handling of system power and
292 sleep keys and the lid switch by taking a low-level inhibitor lock
293 (<literal>handle-power-key</literal>, <literal>handle-suspend-key</literal>,
294 <literal>handle-hibernate-key</literal>, <literal>handle-lid-switch</literal>).
295 This is most commonly used by graphical desktop environments
296 to take over suspend and hibernation handling, and to use their own configuration
297 mechanisms. If a low-level inhibitor lock is taken, logind will not take any
298 action when that key or switch is triggered and the <varname>Handle*=</varname>
299 settings are irrelevant.</para></listitem>
303 <term><varname>PowerKeyIgnoreInhibited=</varname></term>
304 <term><varname>SuspendKeyIgnoreInhibited=</varname></term>
305 <term><varname>HibernateKeyIgnoreInhibited=</varname></term>
306 <term><varname>LidSwitchIgnoreInhibited=</varname></term>
308 <listitem><para>Controls whether actions that <command>systemd-logind</command>
309 takes when the power and sleep keys and the lid switch are triggered are subject
310 to high-level inhibitor locks ("shutdown", "sleep", "idle"). Low level inhibitor
311 locks (<literal>handle-power-key</literal>, <literal>handle-suspend-key</literal>,
312 <literal>handle-hibernate-key</literal>, <literal>handle-lid-switch</literal>),
313 are always honored, irrespective of this setting.</para>
315 <para>These settings take boolean arguments. If <literal>no</literal>, the
316 inhibitor locks taken by applications are respected. If <literal>yes</literal>,
317 "shutdown", "sleep", and "idle" inhibitor locks are ignored.
318 <varname>PowerKeyIgnoreInhibited=</varname>,
319 <varname>SuspendKeyIgnoreInhibited=</varname>, and
320 <varname>HibernateKeyIgnoreInhibited=</varname> default to <literal>no</literal>.
321 <varname>LidSwitchIgnoreInhibited=</varname> defaults to <literal>yes</literal>.
322 This means that when <command>systemd-logind</command> is handling events by
323 itself (no low level inhibitor locks are taken by another application), the lid
324 switch does not respect suspend blockers by default, but the power and sleep keys
325 do.</para></listitem>
329 <term><varname>HoldoffTimeoutSec=</varname></term>
331 <listitem><para>Specifies the timeout after system startup or
332 system resume in which systemd will hold off on reacting to
333 lid events. This is required for the system to properly
334 detect any hotplugged devices so systemd can ignore lid events
335 if external monitors, or docks, are connected. If set to 0,
336 systemd will always react immediately, possibly before the
337 kernel fully probed all hotplugged devices. This is safe, as
338 long as you do not care for systemd to account for devices
339 that have been plugged or unplugged while the system was off.
340 Defaults to 30s.</para></listitem>
344 <term><varname>RuntimeDirectorySize=</varname></term>
346 <listitem><para>Sets the size limit on the
347 <varname>$XDG_RUNTIME_DIR</varname> runtime directory for each
348 user who logs in. Takes a size in bytes, optionally suffixed
349 with the usual K, G, M, and T suffixes, to the base 1024
350 (IEC). Alternatively, a numerical percentage suffixed by
351 <literal>%</literal> may be specified, which sets the size
352 limit relative to the amount of physical RAM. Defaults to 10%.
353 Note that this size is a safety limit only. As each runtime
354 directory is a tmpfs file system, it will only consume as much
355 memory as is needed.</para></listitem>
359 <term><varname>InhibitorsMax=</varname></term>
361 <listitem><para>Controls the maximum number of concurrent inhibitors to permit. Defaults to 8192
362 (8K).</para></listitem>
366 <term><varname>SessionsMax=</varname></term>
368 <listitem><para>Controls the maximum number of concurrent user sessions to manage. Defaults to 8192
369 (8K). Depending on how the <filename>pam_systemd.so</filename> module is included in the PAM stack
370 configuration, further login sessions will either be refused, or permitted but not tracked by
371 <filename>systemd-logind</filename>.</para></listitem>
375 <term><varname>UserTasksMax=</varname></term>
377 <listitem><para>Sets the maximum number of OS tasks each user may run concurrently. This controls the
378 <varname>TasksMax=</varname> setting of the per-user slice unit, see
379 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
380 for details. If assigned the special value <literal>infinity</literal>, no tasks limit is applied.
381 Defaults to 33%, which equals 10813 with the kernel's defaults on the host, but might be smaller in
382 OS containers.</para></listitem>
386 <term><varname>RemoveIPC=</varname></term>
388 <listitem><para>Controls whether System V and POSIX IPC objects belonging to the user shall be removed when the
389 user fully logs out. Takes a boolean argument. If enabled, the user may not consume IPC resources after the
390 last of the user's sessions terminated. This covers System V semaphores, shared memory and message queues, as
391 well as POSIX shared memory and message queues. Note that IPC objects of the root user and other system users
392 are excluded from the effect of this setting. Defaults to <literal>yes</literal>.</para></listitem>
396 <!-- 1 /// elogind has an additional section for system commands. -->
399 <refsect2><title>[Sleep] section:</title>
400 <para><command>elogind</command> supports three general
401 power-saving modes:</para>
407 <listitem><para>a low-power state
408 where execution of the OS is paused,
409 and complete power loss might result
410 in lost data, and which is fast to
411 enter and exit. This corresponds to
412 suspend, standby, or freeze states as
413 understood by the kernel.
418 <term>hibernate</term>
420 <listitem><para>a low-power state
421 where execution of the OS is paused,
422 and complete power loss does not
423 result in lost data, and which might
424 be slow to enter and exit. This
425 corresponds to the hibernation as
426 understood by the kernel.
431 <term>hybrid-sleep</term>
433 <listitem><para>a low-power state
434 where execution of the OS is paused,
435 which might be slow to enter, and on
436 complete power loss does not result in
437 lost data but might be slower to exit
438 in that case. This mode is called
439 suspend-to-both by the kernel.
444 <term><varname>SuspendMode=</varname></term>
445 <term><varname>HibernateMode=</varname></term>
446 <term><varname>HybridSleepMode=</varname></term>
448 <listitem><para>The string to be written to
449 <filename>/sys/power/disk</filename> by elogind.
450 More than one value can be specified by separating
451 multiple values with whitespace. They will be tried
452 in turn, until one is written without error. If
453 neither succeeds, the operation will be aborted.
458 <term><varname>SuspendState=</varname></term>
459 <term><varname>HibernateState=</varname></term>
460 <term><varname>HybridSleepState=</varname></term>
462 <listitem><para>The string to be written to
463 <filename>/sys/power/state</filename> by elogind.
464 More than one value can be specified by separating
465 multiple values with whitespace. They will be tried
466 in turn, until one is written without error. If
467 neither succeeds, the operation will be aborted.
477 <title>See Also</title>
479 <!-- 0 /// elogind is in section 8
480 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
481 <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
483 <citerefentry><refentrytitle>elogind</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
485 <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
486 <!-- 0 /// UNNEEDED by elogind
487 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>