]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-system.conf.xml
tree-wide: drop 'This file is part of systemd' blurb
[thirdparty/systemd.git] / man / systemd-system.conf.xml
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" [
4 <!ENTITY % entities SYSTEM "custom-entities.ent" >
5 %entities;
6 ]>
7
8 <!--
9 SPDX-License-Identifier: LGPL-2.1+
10
11 Copyright 2010 Lennart Poettering
12 -->
13
14 <refentry id="systemd-system.conf"
15 xmlns:xi="http://www.w3.org/2001/XInclude">
16 <refentryinfo>
17 <title>systemd-system.conf</title>
18 <productname>systemd</productname>
19
20 <authorgroup>
21 <author>
22 <contrib>Developer</contrib>
23 <firstname>Lennart</firstname>
24 <surname>Poettering</surname>
25 <email>lennart@poettering.net</email>
26 </author>
27 </authorgroup>
28 </refentryinfo>
29
30 <refmeta>
31 <refentrytitle>systemd-system.conf</refentrytitle>
32 <manvolnum>5</manvolnum>
33 </refmeta>
34
35 <refnamediv>
36 <refname>systemd-system.conf</refname>
37 <refname>system.conf.d</refname>
38 <refname>systemd-user.conf</refname>
39 <refname>user.conf.d</refname>
40 <refpurpose>System and session service manager configuration files</refpurpose>
41 </refnamediv>
42
43 <refsynopsisdiv>
44 <para><filename>/etc/systemd/system.conf</filename>,
45 <filename>/etc/systemd/system.conf.d/*.conf</filename>,
46 <filename>/run/systemd/system.conf.d/*.conf</filename>,
47 <filename>/usr/lib/systemd/system.conf.d/*.conf</filename></para>
48 <para><filename>/etc/systemd/user.conf</filename>,
49 <filename>/etc/systemd/user.conf.d/*.conf</filename>,
50 <filename>/run/systemd/user.conf.d/*.conf</filename>,
51 <filename>/usr/lib/systemd/user.conf.d/*.conf</filename></para>
52 </refsynopsisdiv>
53
54 <refsect1>
55 <title>Description</title>
56
57 <para>When run as a system instance, systemd interprets the
58 configuration file <filename>system.conf</filename> and the files
59 in <filename>system.conf.d</filename> directories; when run as a
60 user instance, systemd interprets the configuration file
61 <filename>user.conf</filename> and the files in
62 <filename>user.conf.d</filename> directories. These configuration
63 files contain a few settings controlling basic manager
64 operations. See
65 <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>5</manvolnum></citerefentry>
66 for a general description of the syntax.</para>
67 </refsect1>
68
69 <xi:include href="standard-conf.xml" xpointer="main-conf" />
70
71 <refsect1>
72 <title>Options</title>
73
74 <para>All options are configured in the
75 <literal>[Manager]</literal> section:</para>
76
77 <variablelist class='systemd-directives'>
78
79 <varlistentry>
80 <term><varname>LogLevel=</varname></term>
81 <term><varname>LogTarget=</varname></term>
82 <term><varname>LogColor=</varname></term>
83 <term><varname>LogLocation=</varname></term>
84 <term><varname>DumpCore=yes</varname></term>
85 <term><varname>CrashChangeVT=no</varname></term>
86 <term><varname>CrashShell=no</varname></term>
87 <term><varname>CrashReboot=no</varname></term>
88 <term><varname>ShowStatus=yes</varname></term>
89 <term><varname>DefaultStandardOutput=journal</varname></term>
90 <term><varname>DefaultStandardError=inherit</varname></term>
91
92 <listitem><para>Configures various parameters of basic manager operation. These options may be overridden by
93 the respective process and kernel command line arguments. See
94 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> for
95 details.</para></listitem>
96 </varlistentry>
97
98 <varlistentry>
99 <term><varname>CtrlAltDelBurstAction=</varname></term>
100
101 <listitem><para>Defines what action will be performed
102 if user presses Ctrl-Alt-Delete more than 7 times in 2s.
103 Can be set to <literal>reboot-force</literal>, <literal>poweroff-force</literal>,
104 <literal>reboot-immediate</literal>, <literal>poweroff-immediate</literal>
105 or disabled with <literal>none</literal>. Defaults to
106 <literal>reboot-force</literal>.
107 </para></listitem>
108 </varlistentry>
109
110 <varlistentry>
111 <term><varname>CPUAffinity=</varname></term>
112
113 <listitem><para>Configures the initial CPU affinity for the
114 init process. Takes a list of CPU indices or ranges separated
115 by either whitespace or commas. CPU ranges are specified by
116 the lower and upper CPU indices separated by a
117 dash.</para></listitem>
118 </varlistentry>
119
120 <varlistentry>
121 <term><varname>JoinControllers=cpu,cpuacct net_cls,netprio</varname></term>
122
123 <listitem><para>Configures controllers that shall be mounted
124 in a single hierarchy. By default, systemd will mount all
125 controllers which are enabled in the kernel in individual
126 hierarchies, with the exception of those listed in this
127 setting. Takes a space-separated list of comma-separated
128 controller names, in order to allow multiple joined
129 hierarchies. Defaults to 'cpu,cpuacct'. Pass an empty string
130 to ensure that systemd mounts all controllers in separate
131 hierarchies.</para>
132
133 <para>Note that this option is only applied once, at very
134 early boot. If you use an initial RAM disk (initrd) that uses
135 systemd, it might hence be necessary to rebuild the initrd if
136 this option is changed, and make sure the new configuration
137 file is included in it. Otherwise, the initrd might mount the
138 controller hierarchies in a different configuration than
139 intended, and the main system cannot remount them
140 anymore.</para></listitem>
141 </varlistentry>
142
143 <varlistentry>
144 <term><varname>RuntimeWatchdogSec=</varname></term>
145 <term><varname>ShutdownWatchdogSec=</varname></term>
146
147 <listitem><para>Configure the hardware watchdog at runtime and at reboot. Takes a timeout value in seconds (or
148 in other time units if suffixed with <literal>ms</literal>, <literal>min</literal>, <literal>h</literal>,
149 <literal>d</literal>, <literal>w</literal>). If <varname>RuntimeWatchdogSec=</varname> is set to a non-zero
150 value, the watchdog hardware (<filename>/dev/watchdog</filename> or the path specified with
151 <varname>WatchdogDevice=</varname> or the kernel option <varname>systemd.watchdog-device=</varname>) will be
152 programmed to automatically reboot the system if it is not contacted within the specified timeout interval. The
153 system manager will ensure to contact it at least once in half the specified timeout interval. This feature
154 requires a hardware watchdog device to be present, as it is commonly the case in embedded and server
155 systems. Not all hardware watchdogs allow configuration of all possible reboot timeout values, in which case
156 the closest available timeout is picked. <varname>ShutdownWatchdogSec=</varname> may be used to configure the
157 hardware watchdog when the system is asked to reboot. It works as a safety net to ensure that the reboot takes
158 place even if a clean reboot attempt times out. Note that the <varname>ShutdownWatchdogSec=</varname> timeout
159 applies only to the second phase of the reboot, i.e. after all regular services are already terminated, and
160 after the system and service manager process (PID 1) got replaced by the <filename>systemd-shutdown</filename>
161 binary, see system <citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry>
162 for details. During the first phase of the shutdown operation the system and service manager remains running
163 and hence <varname>RuntimeWatchdogSec=</varname> is still honoured. In order to define a timeout on this first
164 phase of system shutdown, configure <varname>JobTimeoutSec=</varname> and <varname>JobTimeoutAction=</varname>
165 in the <literal>[Unit]</literal> section of the <filename>shutdown.target</filename> unit. By default
166 <varname>RuntimeWatchdogSec=</varname> defaults to 0 (off), and <varname>ShutdownWatchdogSec=</varname> to
167 10min. These settings have no effect if a hardware watchdog is not available.</para></listitem>
168 </varlistentry>
169
170 <varlistentry>
171 <term><varname>WatchdogDevice=</varname></term>
172
173 <listitem><para>Configure the hardware watchdog device that the
174 runtime and shutdown watchdog timers will open and use. Defaults
175 to <filename>/dev/watchdog</filename>. This setting has no
176 effect if a hardware watchdog is not available.</para></listitem>
177 </varlistentry>
178
179 <varlistentry>
180 <term><varname>CapabilityBoundingSet=</varname></term>
181
182 <listitem><para>Controls which capabilities to include in the
183 capability bounding set for PID 1 and its children. See
184 <citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
185 for details. Takes a whitespace-separated list of capability
186 names as read by
187 <citerefentry project='mankier'><refentrytitle>cap_from_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
188 Capabilities listed will be included in the bounding set, all
189 others are removed. If the list of capabilities is prefixed
190 with ~, all but the listed capabilities will be included, the
191 effect of the assignment inverted. Note that this option also
192 affects the respective capabilities in the effective,
193 permitted and inheritable capability sets. The capability
194 bounding set may also be individually configured for units
195 using the <varname>CapabilityBoundingSet=</varname> directive
196 for units, but note that capabilities dropped for PID 1 cannot
197 be regained in individual units, they are lost for
198 good.</para></listitem>
199 </varlistentry>
200
201 <varlistentry>
202 <term><varname>NoNewPrivileges=</varname></term>
203
204 <listitem><para>Takes a boolean argument. If true, ensures that PID 1
205 and all its children can never gain new privileges through
206 <citerefentry project='man-pages'><refentrytitle>execve</refentrytitle><manvolnum>2</manvolnum></citerefentry>
207 (e.g. via setuid or setgid bits, or filesystem capabilities).
208 Defaults to false. General purpose distributions commonly rely
209 on executables with setuid or setgid bits and will thus not
210 function properly with this option enabled. Individual units
211 cannot disable this option.
212 Also see <ulink url="https://www.kernel.org/doc/html/latest/userspace-api/no_new_privs.html">No New Privileges Flag</ulink>.
213 </para></listitem>
214 </varlistentry>
215
216 <varlistentry>
217 <term><varname>SystemCallArchitectures=</varname></term>
218
219 <listitem><para>Takes a space-separated list of architecture
220 identifiers. Selects from which architectures system calls may
221 be invoked on this system. This may be used as an effective
222 way to disable invocation of non-native binaries system-wide,
223 for example to prohibit execution of 32-bit x86 binaries on
224 64-bit x86-64 systems. This option operates system-wide, and
225 acts similar to the
226 <varname>SystemCallArchitectures=</varname> setting of unit
227 files, see
228 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
229 for details. This setting defaults to the empty list, in which
230 case no filtering of system calls based on architecture is
231 applied. Known architecture identifiers are
232 <literal>x86</literal>, <literal>x86-64</literal>,
233 <literal>x32</literal>, <literal>arm</literal> and the special
234 identifier <literal>native</literal>. The latter implicitly
235 maps to the native architecture of the system (or more
236 specifically, the architecture the system manager was compiled
237 for). Set this setting to <literal>native</literal> to
238 prohibit execution of any non-native binaries. When a binary
239 executes a system call of an architecture that is not listed
240 in this setting, it will be immediately terminated with the
241 SIGSYS signal.</para></listitem>
242 </varlistentry>
243
244 <varlistentry>
245 <term><varname>TimerSlackNSec=</varname></term>
246
247 <listitem><para>Sets the timer slack in nanoseconds for PID 1,
248 which is inherited by all executed processes, unless
249 overridden individually, for example with the
250 <varname>TimerSlackNSec=</varname> setting in service units
251 (for details see
252 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
253 The timer slack controls the accuracy of wake-ups triggered by
254 system timers. See
255 <citerefentry><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>
256 for more information. Note that in contrast to most other time
257 span definitions this parameter takes an integer value in
258 nano-seconds if no unit is specified. The usual time units are
259 understood too.</para></listitem>
260 </varlistentry>
261
262 <varlistentry>
263 <term><varname>DefaultTimerAccuracySec=</varname></term>
264
265 <listitem><para>Sets the default accuracy of timer units. This
266 controls the global default for the
267 <varname>AccuracySec=</varname> setting of timer units, see
268 <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>
269 for details. <varname>AccuracySec=</varname> set in individual
270 units override the global default for the specific unit.
271 Defaults to 1min. Note that the accuracy of timer units is
272 also affected by the configured timer slack for PID 1, see
273 <varname>TimerSlackNSec=</varname> above.</para></listitem>
274 </varlistentry>
275
276 <varlistentry>
277 <term><varname>DefaultTimeoutStartSec=</varname></term>
278 <term><varname>DefaultTimeoutStopSec=</varname></term>
279 <term><varname>DefaultRestartSec=</varname></term>
280
281 <listitem><para>Configures the default timeouts for starting
282 and stopping of units, as well as the default time to sleep
283 between automatic restarts of units, as configured per-unit in
284 <varname>TimeoutStartSec=</varname>,
285 <varname>TimeoutStopSec=</varname> and
286 <varname>RestartSec=</varname> (for services, see
287 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
288 for details on the per-unit settings). For non-service units,
289 <varname>DefaultTimeoutStartSec=</varname> sets the default
290 <varname>TimeoutSec=</varname>
291 value. <varname>DefaultTimeoutStartSec=</varname> and
292 <varname>DefaultTimeoutStopSec=</varname> default to
293 90s. <varname>DefaultRestartSec=</varname> defaults to
294 100ms.</para></listitem>
295 </varlistentry>
296
297 <varlistentry>
298 <term><varname>DefaultStartLimitIntervalSec=</varname></term>
299 <term><varname>DefaultStartLimitBurst=</varname></term>
300
301 <listitem><para>Configure the default unit start rate
302 limiting, as configured per-service by
303 <varname>StartLimitIntervalSec=</varname> and
304 <varname>StartLimitBurst=</varname>. See
305 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
306 for details on the per-service settings.
307 <varname>DefaultStartLimitIntervalSec=</varname> defaults to
308 10s. <varname>DefaultStartLimitBurst=</varname> defaults to
309 5.</para></listitem>
310 </varlistentry>
311
312 <varlistentry>
313 <term><varname>DefaultEnvironment=</varname></term>
314
315 <listitem><para>Sets manager environment variables passed to
316 all executed processes. Takes a space-separated list of
317 variable assignments. See
318 <citerefentry project='man-pages'><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry>
319 for details about environment variables.</para>
320
321 <para>Example:
322
323 <programlisting>DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"</programlisting>
324
325 Sets three variables
326 <literal>VAR1</literal>,
327 <literal>VAR2</literal>,
328 <literal>VAR3</literal>.</para></listitem>
329 </varlistentry>
330
331 <varlistentry>
332 <term><varname>DefaultCPUAccounting=</varname></term>
333 <term><varname>DefaultBlockIOAccounting=</varname></term>
334 <term><varname>DefaultMemoryAccounting=</varname></term>
335 <term><varname>DefaultTasksAccounting=</varname></term>
336 <term><varname>DefaultIPAccounting=</varname></term>
337
338 <listitem><para>Configure the default resource accounting settings, as configured per-unit by
339 <varname>CPUAccounting=</varname>, <varname>BlockIOAccounting=</varname>, <varname>MemoryAccounting=</varname>,
340 <varname>TasksAccounting=</varname> and <varname>IPAccounting=</varname>. See
341 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
342 for details on the per-unit settings. <varname>DefaultTasksAccounting=</varname> defaults to on,
343 <varname>DefaultMemoryAccounting=</varname> to &MEMORY_ACCOUNTING_DEFAULT;,
344 the other three settings to off.</para></listitem>
345 </varlistentry>
346
347 <varlistentry>
348 <term><varname>DefaultTasksMax=</varname></term>
349
350 <listitem><para>Configure the default value for the per-unit <varname>TasksMax=</varname> setting. See
351 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
352 for details. This setting applies to all unit types that support resource control settings, with the exception
353 of slice units. Defaults to 15%, which equals 4915 with the kernel's defaults on the host, but might be smaller
354 in OS containers.</para></listitem>
355 </varlistentry>
356
357 <varlistentry>
358 <term><varname>DefaultLimitCPU=</varname></term>
359 <term><varname>DefaultLimitFSIZE=</varname></term>
360 <term><varname>DefaultLimitDATA=</varname></term>
361 <term><varname>DefaultLimitSTACK=</varname></term>
362 <term><varname>DefaultLimitCORE=</varname></term>
363 <term><varname>DefaultLimitRSS=</varname></term>
364 <term><varname>DefaultLimitNOFILE=</varname></term>
365 <term><varname>DefaultLimitAS=</varname></term>
366 <term><varname>DefaultLimitNPROC=</varname></term>
367 <term><varname>DefaultLimitMEMLOCK=</varname></term>
368 <term><varname>DefaultLimitLOCKS=</varname></term>
369 <term><varname>DefaultLimitSIGPENDING=</varname></term>
370 <term><varname>DefaultLimitMSGQUEUE=</varname></term>
371 <term><varname>DefaultLimitNICE=</varname></term>
372 <term><varname>DefaultLimitRTPRIO=</varname></term>
373 <term><varname>DefaultLimitRTTIME=</varname></term>
374
375 <listitem><para>These settings control various default
376 resource limits for units. See
377 <citerefentry><refentrytitle>setrlimit</refentrytitle><manvolnum>2</manvolnum></citerefentry>
378 for details. The resource limit is possible to specify in two formats,
379 <option>value</option> to set soft and hard limits to the same value,
380 or <option>soft:hard</option> to set both limits individually (e.g. DefaultLimitAS=4G:16G).
381 Use the string <varname>infinity</varname> to
382 configure no limit on a specific resource. The multiplicative
383 suffixes K (=1024), M (=1024*1024) and so on for G, T, P and E
384 may be used for resource limits measured in bytes
385 (e.g. DefaultLimitAS=16G). For the limits referring to time values,
386 the usual time units ms, s, min, h and so on may be used (see
387 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>
388 for details). Note that if no time unit is specified for
389 <varname>DefaultLimitCPU=</varname> the default unit of seconds is
390 implied, while for <varname>DefaultLimitRTTIME=</varname> the default
391 unit of microseconds is implied. Also, note that the effective
392 granularity of the limits might influence their
393 enforcement. For example, time limits specified for
394 <varname>DefaultLimitCPU=</varname> will be rounded up implicitly to
395 multiples of 1s. These settings may be overridden in individual units
396 using the corresponding LimitXXX= directives. Note that these resource
397 limits are only defaults for units, they are not applied to PID 1
398 itself.</para></listitem>
399 </varlistentry>
400 </variablelist>
401 </refsect1>
402
403 <refsect1>
404 <title>See Also</title>
405 <para>
406 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
407 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
408 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
409 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
410 <citerefentry project='man-pages'><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
411 <citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
412 </para>
413 </refsect1>
414
415 </refentry>