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