Debian Codegraph @

man/systemd-system.conf.xml

raw
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.5/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="systemd-system.conf"
10 xmlns:xi="http://www.w3.org/2001/XInclude">
11 <refentryinfo>
12 <title>systemd-system.conf</title>
13 <productname>systemd</productname>
14 </refentryinfo>
15
16 <refmeta>
17 <refentrytitle>systemd-system.conf</refentrytitle>
18 <manvolnum>5</manvolnum>
19 </refmeta>
20
21 <refnamediv>
22 <refname>systemd-system.conf</refname>
23 <refname>system.conf.d</refname>
24 <refname>systemd-user.conf</refname>
25 <refname>user.conf.d</refname>
26 <refpurpose>System and session service manager configuration files</refpurpose>
27 </refnamediv>
28
29 <refsynopsisdiv>
30 <para><filename>/etc/systemd/system.conf</filename>,
31 <filename>/run/systemd/system.conf</filename>,
32 <filename>/usr/lib/systemd/system.conf</filename>,
33 <filename>/etc/systemd/system.conf.d/*.conf</filename>,
34 <filename>/run/systemd/system.conf.d/*.conf</filename>,
35 <filename>/usr/lib/systemd/system.conf.d/*.conf</filename></para>
36
37 <para><filename>~/.config/systemd/user.conf</filename>,
38 <filename>/etc/systemd/user.conf</filename>,
39 <filename>/run/systemd/user.conf</filename>,
40 <filename>/usr/lib/systemd/user.conf</filename>,
41 <filename>/etc/systemd/user.conf.d/*.conf</filename>,
42 <filename>/run/systemd/user.conf.d/*.conf</filename>,
43 <filename>/usr/lib/systemd/user.conf.d/*.conf</filename></para>
44 </refsynopsisdiv>
45
46 <refsect1>
47 <title>Description</title>
48
49 <para>When run as a system instance, <command>systemd</command> interprets the configuration file
50 <filename>system.conf</filename> and the files in <filename>system.conf.d</filename> directories; when
51 run as a user instance, it interprets the configuration file <filename>user.conf</filename> (in order of
52 priority, in the home directory of the user and under <filename>/etc/systemd/</filename>,
53 <filename>/run/systemd/</filename>, and <filename>/usr/lib/systemd/</filename>) and the files in
54 <filename>user.conf.d</filename> directories. These configuration files contain a few settings
55 controlling basic manager operations.</para>
56
57 <para>See
58 <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry> for a
59 general description of the syntax.</para>
60 </refsect1>
61
62 <xi:include href="standard-conf.xml" xpointer="main-conf" />
63
64 <refsect1>
65 <title>Options</title>
66
67 <para>All options are configured in the [Manager] section:</para>
68
69 <variablelist class='config-directives'>
70 <varlistentry>
71 <term><varname>LogColor=</varname></term>
72 <term><varname>LogLevel=</varname></term>
73 <term><varname>LogLocation=</varname></term>
74 <term><varname>LogTarget=</varname></term>
75 <term><varname>LogTime=</varname></term>
76 <term><varname>DumpCore=yes</varname></term>
77 <term><varname>CrashChangeVT=no</varname></term>
78 <term><varname>CrashShell=no</varname></term>
79 <term><varname>CrashAction=freeze</varname></term>
80 <term><varname>ShowStatus=yes</varname></term>
81 <term><varname>DefaultStandardOutput=journal</varname></term>
82 <term><varname>DefaultStandardError=inherit</varname></term>
83
84 <listitem><para>Configures various parameters of basic manager operation. These options may be overridden by
85 the respective process and kernel command line arguments. See
86 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> for
87 details.</para>
88
89 <xi:include href="version-info.xml" xpointer="v198"/></listitem>
90 </varlistentry>
91
92 <varlistentry>
93 <term><varname>CtrlAltDelBurstAction=</varname></term>
94
95 <listitem><para>Defines what action will be performed
96 if user presses Ctrl-Alt-Delete more than 7 times in 2s.
97 Can be set to <literal>reboot-force</literal>, <literal>poweroff-force</literal>,
98 <literal>reboot-immediate</literal>, <literal>poweroff-immediate</literal>
99 or disabled with <literal>none</literal>. Defaults to
100 <literal>reboot-force</literal>.
101 </para>
102
103 <xi:include href="version-info.xml" xpointer="v232"/></listitem>
104 </varlistentry>
105
106 <varlistentry>
107 <term><varname>StatusUnitFormat=</varname></term>
108
109 <listitem><para>Takes <option>name</option>, <option>description</option> or
110 <option>combined</option> as the value. If <option>name</option>, the system manager will use unit
111 names in status messages (e.g. <literal>systemd-journald.service</literal>), instead of the longer
112 and more informative descriptions set with <varname>Description=</varname> (e.g. <literal>Journal
113 Logging Service</literal>). If <option>combined</option>, the system manager will use both unit names
114 and descriptions in status messages (e.g. <literal>systemd-journald.service - Journal Logging
115 Service</literal>).</para>
116
117 <para>See
118 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
119 details about unit names and <varname>Description=</varname>.</para>
120
121 <xi:include href="version-info.xml" xpointer="v243"/></listitem>
122 </varlistentry>
123
124 <varlistentry>
125 <term><varname>DefaultTimerAccuracySec=</varname></term>
126
127 <listitem><para>Sets the default accuracy of timer units. This
128 controls the global default for the
129 <varname>AccuracySec=</varname> setting of timer units, see
130 <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>
131 for details. <varname>AccuracySec=</varname> set in individual
132 units override the global default for the specific unit.
133 Defaults to 1min. Note that the accuracy of timer units is
134 also affected by the configured timer slack for PID 1, see
135 <varname>TimerSlackNSec=</varname> above.</para>
136
137 <xi:include href="version-info.xml" xpointer="v212"/></listitem>
138 </varlistentry>
139 </variablelist>
140 </refsect1>
141
142 <refsect1>
143 <title>Resource Management</title>
144
145 <variablelist class='config-directives'>
146 <varlistentry>
147 <term><varname>TimerSlackNSec=</varname></term>
148
149 <listitem><para>Sets the timer slack in nanoseconds for PID 1,
150 which is inherited by all executed processes, unless
151 overridden individually, for example with the
152 <varname>TimerSlackNSec=</varname> setting in service units
153 (for details see
154 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
155 The timer slack controls the accuracy of wake-ups triggered by
156 system timers. See
157 <citerefentry><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>
158 for more information. Note that in contrast to most other time
159 span definitions this parameter takes an integer value in
160 nano-seconds if no unit is specified. The usual time units are
161 understood too.</para>
162
163 <xi:include href="version-info.xml" xpointer="v198"/></listitem>
164 </varlistentry>
165 <varlistentry>
166 <term><varname>CPUAffinity=</varname></term>
167
168 <listitem><para>Configures the CPU affinity for the service manager as well as the default CPU
169 affinity for all forked off processes. Takes a list of CPU indices or ranges separated by either
170 whitespace or commas. CPU ranges are specified by the lower and upper CPU indices separated by a
171 dash. This option may be specified more than once, in which case the specified CPU affinity masks are
172 merged. If the empty string is assigned, the mask is reset, all assignments prior to this will have
173 no effect. Individual services may override the CPU affinity for their processes with the
174 <varname>CPUAffinity=</varname> setting in unit files, see
175 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
176
177 <xi:include href="version-info.xml" xpointer="v198"/></listitem>
178 </varlistentry>
179
180 <varlistentry>
181 <term><varname>NUMAPolicy=</varname></term>
182
183 <listitem><para>Configures the NUMA memory policy for the service manager and the default NUMA memory policy
184 for all forked off processes. Individual services may override the default policy with the
185 <varname>NUMAPolicy=</varname> setting in unit files, see
186 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
187
188 <xi:include href="version-info.xml" xpointer="v243"/></listitem>
189 </varlistentry>
190
191 <varlistentry>
192 <term><varname>NUMAMask=</varname></term>
193
194 <listitem><para>Configures the NUMA node mask that will be associated with the selected NUMA policy. Note that
195 <option>default</option> and <option>local</option> NUMA policies do not require explicit NUMA node mask and
196 value of the option can be empty. Similarly to <varname>NUMAPolicy=</varname>, value can be overridden
197 by individual services in unit files, see
198 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
199
200 <xi:include href="version-info.xml" xpointer="v243"/></listitem>
201 </varlistentry>
202
203 <varlistentry>
204 <term><varname>DefaultMemoryAccounting=</varname></term>
205 <term><varname>DefaultTasksAccounting=</varname></term>
206 <term><varname>DefaultIOAccounting=</varname></term>
207 <term><varname>DefaultIPAccounting=</varname></term>
208
209 <listitem>
210 <para>Configure the default resource accounting settings, as configured per-unit by
211 <varname>MemoryAccounting=</varname>, <varname>TasksAccounting=</varname>, <varname>IOAccounting=</varname>,
212 and <varname>IPAccounting=</varname>. See
213 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
214 for details on the per-unit settings.</para>
215
216 <para><varname>DefaultMemoryAccounting=</varname> defaults to &MEMORY_ACCOUNTING_DEFAULT;.
217 <varname>DefaultTasksAccounting=</varname> defaults to yes.
218 The other settings default to no.</para>
219
220 <xi:include href="version-info.xml" xpointer="v211"/>
221 </listitem>
222 </varlistentry>
223
224 <varlistentry>
225 <term><varname>DefaultTasksMax=</varname></term>
226
227 <listitem><para>Configure the default value for the per-unit <varname>TasksMax=</varname> setting. See
228 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
229 for details. This setting applies to all unit types that support resource control settings, with the exception
230 of slice units. Defaults to 15% of the minimum of <varname>kernel.pid_max=</varname>, <varname>kernel.threads-max=</varname>
231 and root cgroup <varname>pids.max</varname>.
232 Kernel has a default value for <varname>kernel.pid_max=</varname> and an algorithm of counting in case of more than 32 cores.
233 For example, with the default <varname>kernel.pid_max=</varname>, <varname>DefaultTasksMax=</varname> defaults to 4915,
234 but might be greater in other systems or smaller in OS containers.</para>
235
236 <xi:include href="version-info.xml" xpointer="v228"/></listitem>
237 </varlistentry>
238
239 <varlistentry>
240 <term><varname>DefaultLimitCPU=</varname></term>
241 <term><varname>DefaultLimitFSIZE=</varname></term>
242 <term><varname>DefaultLimitDATA=</varname></term>
243 <term><varname>DefaultLimitSTACK=</varname></term>
244 <term><varname>DefaultLimitCORE=</varname></term>
245 <term><varname>DefaultLimitRSS=</varname></term>
246 <term><varname>DefaultLimitNOFILE=</varname></term>
247 <term><varname>DefaultLimitAS=</varname></term>
248 <term><varname>DefaultLimitNPROC=</varname></term>
249 <term><varname>DefaultLimitMEMLOCK=</varname></term>
250 <term><varname>DefaultLimitLOCKS=</varname></term>
251 <term><varname>DefaultLimitSIGPENDING=</varname></term>
252 <term><varname>DefaultLimitMSGQUEUE=</varname></term>
253 <term><varname>DefaultLimitNICE=</varname></term>
254 <term><varname>DefaultLimitRTPRIO=</varname></term>
255 <term><varname>DefaultLimitRTTIME=</varname></term>
256
257 <listitem><para>These settings control various default resource limits for processes executed by
258 units. See
259 <citerefentry><refentrytitle>setrlimit</refentrytitle><manvolnum>2</manvolnum></citerefentry> for
260 details. These settings may be overridden in individual units using the corresponding
261 <varname>LimitXXX=</varname> directives and they accept the same parameter syntax,
262 see <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
263 for details. Note that these resource limits are only defaults
264 for units, they are not applied to the service manager process (i.e. PID 1) itself.</para>
265
266 <para>Most of these settings are unset, which means the resource limits are inherited from the kernel or, if
267 invoked in a container, from the container manager. However, the following have defaults:</para>
268 <itemizedlist>
269 <listitem><para><varname>DefaultLimitNOFILE=</varname> defaults to 1024:&HIGH_RLIMIT_NOFILE;.
270 </para></listitem>
271
272 <listitem><para><varname>DefaultLimitMEMLOCK=</varname> defaults to 8M.</para></listitem>
273
274 <listitem><para><varname>DefaultLimitCORE=</varname> does not have a default but it is worth mentioning that
275 <varname>RLIMIT_CORE</varname> is set to <literal>infinity</literal> by PID 1 which is inherited by its
276 children.</para></listitem>
277 </itemizedlist>
278
279 <para>Note that the service manager internally in PID 1 bumps <varname>RLIMIT_NOFILE</varname> and
280 <varname>RLIMIT_MEMLOCK</varname> to higher values, however the limit is reverted to the mentioned
281 defaults for all child processes forked off.</para>
282
283 <xi:include href="version-info.xml" xpointer="v198"/>
284 </listitem>
285 </varlistentry>
286
287 <varlistentry>
288 <term><varname>DefaultOOMPolicy=</varname></term>
289
290 <listitem><para>Configure the default policy for reacting to processes being killed by the Linux
291 Out-Of-Memory (OOM) killer or <command>systemd-oomd</command>. This may be used to pick a global default for the per-unit
292 <varname>OOMPolicy=</varname> setting. See
293 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
294 for details. Note that this default is not used for services that have <varname>Delegate=</varname>
295 turned on.</para>
296
297 <xi:include href="version-info.xml" xpointer="v243"/></listitem>
298 </varlistentry>
299
300 <varlistentry>
301 <term><varname>DefaultOOMScoreAdjust=</varname></term>
302
303 <listitem><para>Configures the default OOM score adjustments of processes run by the service
304 manager. This defaults to unset (meaning the forked off processes inherit the service manager's OOM
305 score adjustment value), except if the service manager is run for an unprivileged user, in which case
306 this defaults to the service manager's OOM adjustment value plus 100 (this makes service processes
307 slightly more likely to be killed under memory pressure than the manager itself). This may be used to
308 pick a global default for the per-unit <varname>OOMScoreAdjust=</varname> setting. See
309 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
310 details. Note that this setting has no effect on the OOM score adjustment value of the service
311 manager process itself, it retains the original value set during its invocation.</para>
312
313 <xi:include href="version-info.xml" xpointer="v250"/></listitem>
314 </varlistentry>
315
316 <varlistentry>
317 <term><varname>DefaultMemoryPressureWatch=</varname></term>
318 <term><varname>DefaultMemoryPressureThresholdSec=</varname></term>
319
320 <listitem><para>Configures the default settings for the per-unit
321 <varname>MemoryPressureWatch=</varname> and <varname>MemoryPressureThresholdSec=</varname>
322 settings. See
323 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
324 for details. Defaults to <literal>auto</literal> and <literal>200ms</literal>, respectively. This
325 also sets the memory pressure monitoring threshold for the service manager itself.</para>
326
327 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
328 </varlistentry>
329
330 <varlistentry>
331 <term><varname>DefaultCPUPressureWatch=</varname></term>
332 <term><varname>DefaultCPUPressureThresholdSec=</varname></term>
333
334 <listitem><para>Configures the default settings for the per-unit
335 <varname>CPUPressureWatch=</varname> and <varname>CPUPressureThresholdSec=</varname>
336 settings. See
337 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
338 for details. Defaults to <literal>auto</literal> and <literal>200ms</literal>, respectively. This
339 also sets the CPU pressure monitoring threshold for the service manager itself.</para>
340
341 <xi:include href="version-info.xml" xpointer="v261"/></listitem>
342 </varlistentry>
343
344 <varlistentry>
345 <term><varname>DefaultIOPressureWatch=</varname></term>
346 <term><varname>DefaultIOPressureThresholdSec=</varname></term>
347
348 <listitem><para>Configures the default settings for the per-unit
349 <varname>IOPressureWatch=</varname> and <varname>IOPressureThresholdSec=</varname>
350 settings. See
351 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
352 for details. Defaults to <literal>auto</literal> and <literal>200ms</literal>, respectively. This
353 also sets the IO pressure monitoring threshold for the service manager itself.</para>
354
355 <xi:include href="version-info.xml" xpointer="v261"/></listitem>
356 </varlistentry>
357 </variablelist>
358 </refsect1>
359
360 <refsect1>
361 <title>Hardware Watchdog</title>
362
363 <variablelist class='config-directives'>
364 <varlistentry>
365 <term><varname>RuntimeWatchdogSec=</varname></term>
366 <term><varname>RebootWatchdogSec=</varname></term>
367 <term><varname>KExecWatchdogSec=</varname></term>
368
369 <listitem><para>Configure the hardware watchdog at runtime and at reboot. Takes a timeout value in
370 seconds (or in other time units if suffixed with <literal>ms</literal>, <literal>min</literal>,
371 <literal>h</literal>, <literal>d</literal>, <literal>w</literal>), or the special strings
372 <literal>off</literal> or <literal>default</literal>. If set to <literal>off</literal>
373 (alternatively: <literal>0</literal>) the watchdog logic is disabled: no watchdog device is opened,
374 configured, or pinged. If set to the special string <literal>default</literal> the watchdog is opened
375 and pinged in regular intervals, but the timeout is not changed from the default. If set to any other
376 time value the watchdog timeout is configured to the specified value (or a value close to it,
377 depending on hardware capabilities).</para>
378
379 <para>If <varname>RuntimeWatchdogSec=</varname> is set to a non-zero value, the watchdog hardware
380 (<filename>/dev/watchdog0</filename> or the path specified with <varname>WatchdogDevice=</varname> or
381 the kernel option <varname>systemd.watchdog_device=</varname>) will be programmed to automatically
382 reboot the system if it is not contacted within the specified timeout interval. The system manager
383 will ensure to contact it at least once in half the specified timeout interval. This feature requires
384 a hardware watchdog device to be present, as it is commonly the case in embedded and server
385 systems. Not all hardware watchdogs allow configuration of all possible reboot timeout values, in
386 which case the closest available timeout is picked.</para>
387
388 <para><varname>RebootWatchdogSec=</varname> may be used to configure the hardware watchdog when the
389 system is asked to reboot. It works as a safety net to ensure that the reboot takes place even if a
390 clean reboot attempt times out. Note that the <varname>RebootWatchdogSec=</varname> timeout applies
391 only to the second phase of the reboot, i.e. after all regular services are already terminated, and
392 after the system and service manager process (PID 1) got replaced by the
393 <filename>systemd-shutdown</filename> binary, see system
394 <citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
395 details. During the first phase of the shutdown operation the system and service manager remains
396 running and hence <varname>RuntimeWatchdogSec=</varname> is still honoured. In order to define a
397 timeout on this first phase of system shutdown, configure <varname>JobTimeoutSec=</varname> and
398 <varname>JobTimeoutAction=</varname> in the [Unit] section of the
399 <filename>shutdown.target</filename> unit. By default, <varname>RuntimeWatchdogSec=</varname> defaults
400 to 0 (off), and <varname>RebootWatchdogSec=</varname> to 10min.</para>
401
402 <para><varname>KExecWatchdogSec=</varname> may be used to additionally enable the watchdog when kexec
403 is being executed rather than when rebooting. Note that if the kernel does not reset the watchdog on
404 kexec (depending on the specific hardware and/or driver), in this case the watchdog might not get
405 disabled after kexec succeeds and thus the system might get rebooted, unless
406 <varname>RuntimeWatchdogSec=</varname> is also enabled at the same time. For this reason it is
407 recommended to enable <varname>KExecWatchdogSec=</varname> only if
408 <varname>RuntimeWatchdogSec=</varname> is also enabled.</para>
409
410 <para>These settings have no effect if a hardware watchdog is not available.</para>
411
412 <xi:include href="version-info.xml" xpointer="v198"/></listitem>
413 </varlistentry>
414
415 <varlistentry>
416 <term><varname>RuntimeWatchdogPreSec=</varname></term>
417
418 <listitem><para>Configure the hardware watchdog device pre-timeout value.
419 Takes a timeout value in seconds (or in other time units similar to
420 <varname>RuntimeWatchdogSec=</varname>). A watchdog pre-timeout is a
421 notification generated by the watchdog before the watchdog reset might
422 occur in the event the watchdog has not been serviced. This notification
423 is handled by the kernel and can be configured to take an action (i.e.
424 generate a kernel panic) using <varname>RuntimeWatchdogPreGovernor=</varname>.
425 Not all watchdog hardware or drivers support generating a pre-timeout and
426 depending on the state of the system, the kernel may be unable to take the
427 configured action before the watchdog reboot. The watchdog will be configured
428 to generate the pre-timeout event at the amount of time specified by
429 <varname>RuntimeWatchdogPreSec=</varname> before the runtime watchdog timeout
430 (set by <varname>RuntimeWatchdogSec=</varname>). For example, if the we have
431 <varname>RuntimeWatchdogSec=30</varname> and
432 <varname>RuntimeWatchdogPreSec=10</varname>, then the pre-timeout event
433 will occur if the watchdog has not pinged for 20s (10s before the
434 watchdog would fire). By default, <varname>RuntimeWatchdogPreSec=</varname>
435 defaults to 0 (off). The value set for <varname>RuntimeWatchdogPreSec=</varname>
436 must be smaller than the timeout value for <varname>RuntimeWatchdogSec=</varname>.
437 This setting has no effect if a hardware watchdog is not available or the
438 hardware watchdog does not support a pre-timeout and will be ignored by the
439 kernel if the setting is greater than the actual watchdog timeout.</para>
440
441 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
442 </varlistentry>
443
444 <varlistentry>
445 <term><varname>RuntimeWatchdogPreGovernor=</varname></term>
446
447 <listitem><para>Configure the action taken by the hardware watchdog device
448 when the pre-timeout expires. The default action for the pre-timeout event
449 depends on the kernel configuration, but it is usually to log a kernel
450 message. For a list of valid actions available for a given watchdog device,
451 check the content of the
452 <filename>/sys/class/watchdog/watchdog<replaceable>X</replaceable>/pretimeout_available_governors</filename>
453 file. Typically, available governor types are <varname>noop</varname> and <varname>panic</varname>.
454 Availability, names and functionality might vary depending on the specific device driver
455 in use. If the <filename>pretimeout_available_governors</filename> sysfs file is empty,
456 the governor might be built as a kernel module and might need to be manually loaded
457 (e.g. <varname>pretimeout_noop.ko</varname>), or the watchdog device might not support
458 pre-timeouts.</para>
459
460 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
461 </varlistentry>
462
463 <varlistentry>
464 <term><varname>WatchdogDevice=</varname></term>
465
466 <listitem><para>Configure the hardware watchdog device that the
467 runtime and shutdown watchdog timers will open and use. Defaults
468 to <filename>/dev/watchdog0</filename>. This setting has no
469 effect if a hardware watchdog is not available.</para>
470
471 <xi:include href="version-info.xml" xpointer="v236"/></listitem>
472 </varlistentry>
473 </variablelist>
474 </refsect1>
475
476 <refsect1>
477 <title>Security</title>
478
479 <variablelist class='config-directives'>
480 <varlistentry>
481 <term><varname>CapabilityBoundingSet=</varname></term>
482
483 <listitem><para>Controls which capabilities to include in the
484 capability bounding set for PID 1 and its children. See
485 <citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
486 for details. Takes a whitespace-separated list of capability
487 names as read by
488 <citerefentry project='mankier'><refentrytitle>cap_from_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
489 Capabilities listed will be included in the bounding set, all
490 others are removed. If the list of capabilities is prefixed
491 with ~, all but the listed capabilities will be included, the
492 effect of the assignment inverted. Note that this option also
493 affects the respective capabilities in the effective,
494 permitted and inheritable capability sets. The capability
495 bounding set may also be individually configured for units
496 using the <varname>CapabilityBoundingSet=</varname> directive
497 for units, but note that capabilities dropped for PID 1 cannot
498 be regained in individual units, they are lost for
499 good.</para>
500
501 <xi:include href="version-info.xml" xpointer="v198"/></listitem>
502 </varlistentry>
503
504 <varlistentry>
505 <term><varname>NoNewPrivileges=</varname></term>
506
507 <listitem><para>Takes a boolean argument. If true, ensures that PID 1
508 and all its children can never gain new privileges through
509 <citerefentry project='man-pages'><refentrytitle>execve</refentrytitle><manvolnum>2</manvolnum></citerefentry>
510 (e.g. via setuid or setgid bits, or filesystem capabilities).
511 Defaults to false. General purpose distributions commonly rely
512 on executables with setuid or setgid bits and will thus not
513 function properly with this option enabled. Individual units
514 cannot disable this option.
515 Also see <ulink url="https://docs.kernel.org/userspace-api/no_new_privs.html">No New Privileges Flag</ulink>.
516 </para>
517
518 <xi:include href="version-info.xml" xpointer="v239"/></listitem>
519 </varlistentry>
520
521 <varlistentry>
522 <term><varname>ProtectSystem=</varname></term>
523
524 <listitem><para>Takes a boolean argument or the string <literal>auto</literal>. If set to true this
525 will remount <filename>/usr/</filename> read-only. If set to <literal>auto</literal> (the default)
526 and running in an initrd equivalent to true, otherwise false. This implements a restricted subset of
527 the per-unit setting of the same name, see
528 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
529 details: currently, the <literal>full</literal> or <literal>strict</literal> values are not
530 supported.</para>
531
532 <xi:include href="version-info.xml" xpointer="v256"/></listitem>
533 </varlistentry>
534
535 <varlistentry>
536 <term><varname>RestrictFileSystemAccess=</varname></term>
537
538 <listitem><para>Takes a boolean argument or the special value <literal>exec</literal>. Defaults to
539 <literal>no</literal>. When enabled, PID 1 loads a BPF LSM program that enforces a deny-default
540 execution policy: only binaries residing on signed dm-verity block devices (and the initramfs during
541 early boot) are permitted to execute. Execution from tmpfs, procfs, sysfs, unsigned dm-verity devices,
542 and anonymous executable memory mappings is denied.</para>
543
544 <para>This setting is intended as one component of an image-based, fully verified system, where the
545 whole boot chain (firmware, kernel image, kernel command line, initramfs) is measured and attested.
546 On a general-purpose system without such guarantees it does not provide a meaningful security
547 boundary on its own: an attacker with sufficient privilege to edit
548 <filename>system.conf</filename>, modify the kernel command line, or kexec into an unsigned initrd
549 can disable or bypass the policy.</para>
550
551 <para>The enforcement hooks block <function>execve()</function> of untrusted binaries
552 (<literal>bprm_check_security</literal>), <constant>PROT_EXEC</constant> memory mappings including
553 shared libraries (<literal>mmap_file</literal>), and write-to-execute transitions such as JIT
554 compilation (<literal>file_mprotect</literal>).</para>
555
556 <para>Note that execution from overlayfs mounts is blocked even if the underlying layers reside on
557 signed dm-verity devices, because the BPF program sees the overlay filesystem's anonymous device
558 number rather than the underlying block device. Multi-device filesystems such as btrfs are similarly
559 unsupported.</para>
560
561 <para>Note that, without further measures to secure the system, kexec can be used to circumvent this.</para>
562
563 <para>This requires the kernel to be booted with <literal>dm_verity.require_signatures=1</literal>
564 on the kernel command line and with BPF LSM enabled (<literal>lsm=...,bpf</literal>). If either
565 prerequisite is not met, PID 1 will refuse to complete startup.</para>
566
567 <para>The value <literal>yes</literal> is equivalent to <literal>exec</literal>. Additional
568 modes may be added in the future.</para>
569
570 <para>This option may also be set via the <varname>systemd.restrict_filesystem_access=</varname> kernel command
571 line option, see
572 <citerefentry><refentrytitle>kernel-command-line</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
573 </para>
574
575 <xi:include href="version-info.xml" xpointer="v261"/></listitem>
576 </varlistentry>
577
578 <varlistentry>
579 <term><varname>SystemCallArchitectures=</varname></term>
580
581 <listitem><para>Takes a space-separated list of architecture
582 identifiers. Selects from which architectures system calls may
583 be invoked on this system. This may be used as an effective
584 way to disable invocation of non-native binaries system-wide,
585 for example to prohibit execution of 32-bit x86 binaries on
586 64-bit x86-64 systems. This option operates system-wide, and
587 acts similar to the
588 <varname>SystemCallArchitectures=</varname> setting of unit
589 files, see
590 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
591 for details. This setting defaults to the empty list, in which
592 case no filtering of system calls based on architecture is
593 applied. Known architecture identifiers are
594 <literal>x86</literal>, <literal>x86-64</literal>,
595 <literal>x32</literal>, <literal>arm</literal> and the special
596 identifier <literal>native</literal>. The latter implicitly
597 maps to the native architecture of the system (or more
598 specifically, the architecture the system manager was compiled
599 for). Set this setting to <literal>native</literal> to
600 prohibit execution of any non-native binaries. When a binary
601 executes a system call of an architecture that is not listed
602 in this setting, it will be immediately terminated with the
603 SIGSYS signal.</para>
604
605 <xi:include href="version-info.xml" xpointer="v209"/></listitem>
606 </varlistentry>
607
608 <varlistentry>
609 <term><varname>DefaultSmackProcessLabel=</varname></term>
610
611 <listitem><para>Takes a <option>SMACK64</option> security label as the argument. The process executed
612 by a unit will be started under this label if <varname>SmackProcessLabel=</varname> is not set in the
613 unit. See <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
614 for the details.</para>
615
616 <para>If the value is <literal>/</literal>, only labels specified with <varname>SmackProcessLabel=</varname>
617 are assigned and the compile-time default is ignored.</para>
618
619 <xi:include href="version-info.xml" xpointer="v252"/></listitem>
620 </varlistentry>
621
622 <varlistentry>
623 <term><varname>DefaultRestrictSUIDSGID=</varname></term>
624
625 <listitem><para>Takes a boolean argument. This is used as a default for units
626 which lack an explicit definition for <varname>RestrictSUIDSGID=</varname>.
627 See <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
628 for the details.</para>
629
630 <xi:include href="version-info.xml" xpointer="v258"/></listitem>
631 </varlistentry>
632 </variablelist>
633 </refsect1>
634
635 <refsect1>
636 <title>Timeouts and Rate Limits</title>
637
638 <variablelist class='config-directives'>
639 <varlistentry>
640 <term><varname>DefaultTimeoutStartSec=</varname></term>
641 <term><varname>DefaultTimeoutStopSec=</varname></term>
642 <term><varname>DefaultTimeoutAbortSec=</varname></term>
643 <term><varname>DefaultRestartSec=</varname></term>
644
645 <listitem><para>Configures the default timeouts for starting, stopping and aborting of units, as well
646 as the default time to sleep between automatic restarts of units, as configured per-unit in
647 <varname>TimeoutStartSec=</varname>, <varname>TimeoutStopSec=</varname>,
648 <varname>TimeoutAbortSec=</varname> and <varname>RestartSec=</varname> (for services, see
649 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
650 for details on the per-unit settings). For non-service units,
651 <varname>DefaultTimeoutStartSec=</varname> sets the default <varname>TimeoutSec=</varname> value.
652 </para>
653
654 <para><varname>DefaultTimeoutStartSec=</varname> and <varname>DefaultTimeoutStopSec=</varname>
655 default to &DEFAULT_TIMEOUT_SEC; in the system manager and &DEFAULT_USER_TIMEOUT_SEC; in the user
656 manager. <varname>DefaultTimeoutAbortSec=</varname> is not set by default so that all units fall back
657 to <varname>TimeoutStopSec=</varname>. <varname>DefaultRestartSec=</varname> defaults to 100 ms.
658 </para>
659
660 <xi:include href="version-info.xml" xpointer="v209"/></listitem>
661 </varlistentry>
662
663 <varlistentry>
664 <term><varname>DefaultDeviceTimeoutSec=</varname></term>
665
666 <listitem><para>Configures the default timeout for waiting for devices. It can be changed per
667 device via the <varname>x-systemd.device-timeout=</varname> option in <filename>/etc/fstab</filename>
668 and <filename>/etc/crypttab</filename> (see
669 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
670 <citerefentry><refentrytitle>crypttab</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
671 Defaults to &DEFAULT_TIMEOUT_SEC; in the system manager and &DEFAULT_USER_TIMEOUT_SEC; in the user
672 manager.</para>
673
674 <xi:include href="version-info.xml" xpointer="v252"/></listitem>
675 </varlistentry>
676
677 <varlistentry>
678 <term><varname>DefaultStartLimitIntervalSec=</varname></term>
679 <term><varname>DefaultStartLimitBurst=</varname></term>
680
681 <listitem><para>Configure the default unit start rate
682 limiting, as configured per-service by
683 <varname>StartLimitIntervalSec=</varname> and
684 <varname>StartLimitBurst=</varname>. See
685 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
686 for details on the per-service settings.
687 <varname>DefaultStartLimitIntervalSec=</varname> defaults to
688 10s. <varname>DefaultStartLimitBurst=</varname> defaults to
689 5.</para>
690
691 <xi:include href="version-info.xml" xpointer="v209"/></listitem>
692 </varlistentry>
693
694 <varlistentry>
695 <term><varname>ReloadLimitIntervalSec=</varname></term>
696 <term><varname>ReloadLimitBurst=</varname></term>
697
698 <listitem><para>Rate limiting for daemon-reload and (since v256) daemon-reexec requests. The setting
699 applies to both operations, but the rate limits are tracked separately. Defaults to unset, and any
700 number of operations can be requested at any time. <varname>ReloadLimitIntervalSec=</varname> takes
701 a value in seconds to configure the rate limit window, and <varname>ReloadLimitBurst=</varname>
702 takes a positive integer to configure the maximum allowed number of operations within the configured
703 time window.</para>
704
705 <xi:include href="version-info.xml" xpointer="v253"/></listitem>
706 </varlistentry>
707
708 <varlistentry>
709 <term><varname>EventLoopRateLimitIntervalSec=</varname></term>
710 <term><varname>EventLoopRateLimitBurst=</varname></term>
711
712 <listitem><para>Configures the rate limiting applied to the manager's main event loop. If the event
713 loop iterates more than <varname>EventLoopRateLimitBurst=</varname> times within
714 <varname>EventLoopRateLimitIntervalSec=</varname>, event processing is briefly paused to prevent
715 excessive CPU usage. <varname>EventLoopRateLimitIntervalSec=</varname> defaults to 1s.
716 <varname>EventLoopRateLimitBurst=</varname> defaults to 50000. These settings can also be set on the
717 kernel command line via
718 <varname>systemd.event_loop_ratelimit_interval_sec=</varname> and
719 <varname>systemd.event_loop_ratelimit_burst=</varname>.</para>
720
721 <xi:include href="version-info.xml" xpointer="v261"/></listitem>
722 </varlistentry>
723
724 <varlistentry>
725 <term><varname>MinimumUptimeSec=</varname></term>
726
727 <listitem><para>Specifies the minimum uptime for the system which has to be reached before a shutdown
728 is executed. Defaults to 15s. This mechanism is introduced to avoid high frequency reboot loops, when
729 technical failures trigger an automatic shutdown during the boot process. Each reboot cycle is
730 delayed to the specified minimum time, giving the user a chance to review screen contents or
731 otherwise interact with the device before the shutdown proceeds. The delay takes place during the
732 very last phase of system shutdown, immediately before the <function>reboot()</function> system call
733 is executed. If the system is already running for longer than the specified time, this setting has no
734 effect. This logic is also skipped in container environments. Set to zero in order to disable this
735 logic.</para>
736
737 <xi:include href="version-info.xml" xpointer="v261"/></listitem>
738 </varlistentry>
739 </variablelist>
740 </refsect1>
741
742 <refsect1>
743 <title>Environment</title>
744
745 <variablelist class='config-directives'>
746 <varlistentry>
747 <term><varname>DefaultEnvironment=</varname></term>
748
749 <listitem><para>Configures environment variables passed to all executed processes. Takes a
750 space-separated list of variable assignments. See <citerefentry
751 project='man-pages'><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
752 details about environment variables. This environment block is internal, and changes are not
753 reflected in the manager's <filename>/proc/PID/environ</filename>.
754 </para>
755
756 <para>Simple <literal>%</literal>-specifier expansion is supported, see below for a list of supported
757 specifiers.</para>
758
759 <para>Example:
760
761 <programlisting>DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"</programlisting>
762
763 Sets three variables
764 <literal>VAR1</literal>,
765 <literal>VAR2</literal>,
766 <literal>VAR3</literal>.</para>
767
768 <xi:include href="version-info.xml" xpointer="v205"/></listitem>
769 </varlistentry>
770
771 <varlistentry>
772 <term><varname>ManagerEnvironment=</varname></term>
773
774 <listitem><para>Sets environment variables for the manager process itself. Takes a space-separated
775 list of variable assignment in the same format as <varname>DefaultEnvironment=</varname>, see above.
776 These variables are merged into the existing environment block of the manager process. In particular,
777 in case of the system manager, this block includes variables set by the kernel based on the kernel
778 command line, and in case of the user manager, the variables passed by the system manager. After
779 those variables have been merged, they will persist until overridden, even if the manager is reloaded
780 or reexecuted. In case of the user manager, these variables are also inherited by processes spawned
781 by the manager. As with <varname>DefaultEnvironment=</varname>, this environment block is internal,
782 and changes are not reflected in the manager's <filename>/proc/PID/environ</filename>.</para>
783
784 <para>Setting environment variables for the manager process may be useful to modify its behaviour.
785 See <ulink url="https://systemd.io/ENVIRONMENT">Known Environment Variables</ulink> for a description
786 of some variables understood by <command>systemd</command>.</para>
787
788 <para>Simple <literal>%</literal>-specifier expansion is supported, see below for a list of supported
789 specifiers.</para>
790
791 <xi:include href="version-info.xml" xpointer="v248"/>
792 </listitem>
793 </varlistentry>
794
795 <varlistentry>
796 <term><varname>DefaultMemoryZSwapWriteback=</varname></term>
797
798 <listitem><para>Takes a boolean argument. Defaults to true if unspecified. This is used as a default
799 for units which lack an explicit definition for <varname>MemoryZSwapWriteback=</varname>.
800 See <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
801 for the details.</para>
802
803 <xi:include href="version-info.xml" xpointer="v261"/>
804 </listitem>
805 </varlistentry>
806 </variablelist>
807 </refsect1>
808
809 <refsect1>
810 <title>Specifiers</title>
811
812 <para>Specifiers may be used in the <varname>DefaultEnvironment=</varname> and
813 <varname>ManagerEnvironment=</varname> settings. The following expansions are understood:</para>
814 <table class='specifiers'>
815 <title>Specifiers available</title>
816 <tgroup cols='3' align='left' colsep='1' rowsep='1'>
817 <colspec colname="spec" />
818 <colspec colname="mean" />
819 <colspec colname="detail" />
820 <thead>
821 <row>
822 <entry>Specifier</entry>
823 <entry>Meaning</entry>
824 <entry>Details</entry>
825 </row>
826 </thead>
827 <tbody>
828 <xi:include href="standard-specifiers.xml" xpointer="a"/>
829 <xi:include href="standard-specifiers.xml" xpointer="A"/>
830 <xi:include href="standard-specifiers.xml" xpointer="b"/>
831 <xi:include href="standard-specifiers.xml" xpointer="B"/>
832 <xi:include href="standard-specifiers.xml" xpointer="H"/>
833 <xi:include href="standard-specifiers.xml" xpointer="l"/>
834 <xi:include href="standard-specifiers.xml" xpointer="m"/>
835 <xi:include href="standard-specifiers.xml" xpointer="M"/>
836 <xi:include href="standard-specifiers.xml" xpointer="o"/>
837 <xi:include href="standard-specifiers.xml" xpointer="v"/>
838 <xi:include href="standard-specifiers.xml" xpointer="w"/>
839 <xi:include href="standard-specifiers.xml" xpointer="W"/>
840 <xi:include href="standard-specifiers.xml" xpointer="T"/>
841 <xi:include href="standard-specifiers.xml" xpointer="V"/>
842 <row>
843 <entry><literal>%h</literal></entry>
844 <entry>User home directory</entry>
845 <entry>This is the home directory of the <emphasis>user running the service manager instance</emphasis>.</entry>
846 </row>
847 <row>
848 <entry><literal>%u</literal></entry>
849 <entry>Username</entry>
850 <entry>This is the username of the <emphasis>user running the service manager instance</emphasis>.</entry>
851 </row>
852 <row>
853 <entry><literal>%U</literal></entry>
854 <entry>User id</entry>
855 <entry>This is the user id of the <emphasis>user running the service manager instance</emphasis>.</entry>
856 </row>
857 <row>
858 <entry><literal>%g</literal></entry>
859 <entry>Primary group</entry>
860 <entry>This is the primary group of the <emphasis>user running the service manager instance</emphasis>.</entry>
861 </row>
862 <row>
863 <entry><literal>%G</literal></entry>
864 <entry>Primary group id</entry>
865 <entry>This is the primary group id of the <emphasis>user running the service manager instance</emphasis>.</entry>
866 </row>
867 <row>
868 <entry><literal>%s</literal></entry>
869 <entry>User shell</entry>
870 <entry>This is the shell of the <emphasis>user running the service manager instance</emphasis>.</entry>
871 </row>
872 <xi:include href="standard-specifiers.xml" xpointer="percent"/>
873 </tbody>
874 </tgroup>
875 </table>
876 </refsect1>
877
878 <refsect1>
879 <title>History</title>
880
881 <variablelist>
882 <varlistentry>
883 <term>systemd 252</term>
884
885 <listitem><para>Option <varname>DefaultBlockIOAccounting=</varname> was deprecated. Please switch
886 to the unified cgroup hierarchy.</para></listitem>
887 </varlistentry>
888 </variablelist>
889
890 <variablelist>
891 <varlistentry>
892 <term>systemd 258</term>
893
894 <listitem><para><varname>DefaultCPUAccounting=</varname> setting is deprecated, because CPU accounting
895 is always available on the unified cgroup hierarchy and such setting has no effect.</para></listitem>
896 </varlistentry>
897 </variablelist>
898 </refsect1>
899
900 <refsect1>
901 <title>See Also</title>
902 <para><simplelist type="inline">
903 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
904 <member><citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
905 <member><citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
906 <member><citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
907 <member><citerefentry project='man-pages'><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
908 <member><citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
909 </simplelist></para>
910 </refsect1>
911
912 </refentry>