]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/standard-conf.xml
Merge pull request #18007 from fw-strlen/ipv6_masq_and_dnat
[thirdparty/systemd.git] / man / standard-conf.xml
CommitLineData
514094f9 1<?xml version="1.0"?>
d3fae78f 2<!DOCTYPE refsection PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
d3fae78f 4
f48f7543 5<!--
db9ecf05 6 SPDX-License-Identifier: LGPL-2.1-or-later
96b2fb93 7 Copyright © 2014 Josh Triplett
f48f7543
ZJS
8-->
9
d3fae78f
JT
10<refsection>
11 <refsection id='confd'>
12 <title>Configuration Directories and Precedence</title>
13
e76c60bf
ZJS
14 <para>Configuration files are read from directories in <filename>/etc/</filename>,
15 <filename>/run/</filename>, <filename>/usr/local/lib/</filename>, and <filename>/usr/lib/</filename>, in
37b22b3b 16 order of precedence, as listed in the SYNOPSIS section above. Files must have the
e76c60bf
ZJS
17 <literal>.conf</literal> extension. Files in <filename>/etc/</filename> override files with the same name
18 in <filename>/run/</filename>, <filename>/usr/local/lib/</filename>, and
19 <filename>/usr/lib/</filename>. Files in <filename>/run/</filename> override files with the same name
20 under <filename>/usr/</filename>.</para>
5ae4336a 21
e76c60bf
ZJS
22 <para>All configuration files are sorted by their filename in lexicographic order, regardless of which of
23 the directories they reside in. If multiple files specify the same option, the entry in the file with the
24 lexicographically latest name will take precedence. Thus, the configuration in a certain file may either
25 be replaced completely (by placing a file with the same name in a directory with higher priority), or
26 individual settings might be changed (by specifying additional settings in a file with a different name
27 that is ordered later).</para>
d3fae78f 28
e76c60bf
ZJS
29 <para>Packages should install their configuration files in <filename>/usr/lib/</filename> (distribution
30 packages) or <filename>/usr/local/lib/</filename> (local installs). Files in <filename>/etc/</filename>
31 are reserved for the local administrator, who may use this logic to override the configuration files
32 installed by vendor packages. It is recommended to prefix all filenames with a two-digit number and a
33 dash, to simplify the ordering of the files.</para>
34
35 <para>If the administrator wants to disable a configuration file supplied by the vendor, the recommended
36 way is to place a symlink to <filename>/dev/null</filename> in the configuration directory in
37 <filename>/etc/</filename>, with the same filename as the vendor configuration file. If the vendor
38 configuration file is included in the initrd image, the image has to be regenerated.</para>
d3fae78f
JT
39 </refsection>
40
e93549ef
ZJS
41 <refsection id='main-conf'>
42 <title>Configuration Directories and Precedence</title>
43
a7a18878
ZJS
44 <para>The default configuration is set during compilation, so configuration is only needed when it is
45 necessary to deviate from those defaults. Initially, the main configuration file in
46 <filename>/etc/systemd/</filename> contains commented out entries showing the defaults as a guide to the
47 administrator. Local overrides can be created by editing this file or by creating drop-ins, see below.
e93549ef
ZJS
48 </para>
49
a7a18878
ZJS
50 <para>In addition to the "main" configuration file, drop-in configuration snippets are read from
51 <filename>/usr/lib/systemd/*.conf.d/</filename>, <filename>/usr/local/lib/systemd/*.conf.d/</filename>,
52 and <filename>/etc/systemd/*.conf.d/</filename>. Those drop-ins have higher precedence and override the
53 main configuration file. Files in the <filename>*.conf.d/</filename> configuration subdirectories are
54 sorted by their filename in lexicographic order, regardless of in which of the subdirectories they
55 reside. When multiple files specify the same option, for options which accept just a single value, the
56 entry in the file sorted last takes precedence, and for options which accept a list of values, entries
57 are collected as they occur in the sorted files.</para>
e76c60bf 58
a7a18878
ZJS
59 <para>When packages need to customize the configuration, they can install drop-ins under
60 <filename>/usr/</filename>. Files in <filename>/etc/</filename> are reserved for the local administrator,
61 who may use this logic to override the configuration files installed by vendor packages. Drop-ins have to
62 be used to override package drop-ins, since the main configuration file has lower precedence. It is
63 recommended to prefix all filenames in those subdirectories with a two-digit number and a dash, to
64 simplify the ordering of the files.</para>
e93549ef 65
a7a18878
ZJS
66 <para>To disable a configuration file supplied by the vendor, the recommended way is to place a symlink
67 to <filename>/dev/null</filename> in the configuration directory in <filename>/etc/</filename>, with the
68 same filename as the vendor configuration file.</para>
d3fae78f
JT
69 </refsection>
70</refsection>