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