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