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