]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/standard-conf.xml
Merge pull request #8822 from fbuihuu/rfc-tmpfiles-safe-upstream
[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
ZJS
5<!--
6 SPDX-License-Identifier: LGPL-2.1+
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
14 <para>Configuration files are read from directories in
15 <filename>/etc/</filename>, <filename>/run/</filename>, and
16 <filename>/usr/lib/</filename>, in order of precedence.
17 Each configuration file in these configuration directories shall be named in
18 the style of <filename><replaceable>filename</replaceable>.conf</filename>.
19 Files in <filename>/etc/</filename> override files with the same name in
20 <filename>/run/</filename> and <filename>/usr/lib/</filename>. Files in
21 <filename>/run/</filename> override files with the same name in
22 <filename>/usr/lib/</filename>.</para>
23
24 <para>Packages should install their configuration files in
25 <filename>/usr/lib/</filename>. Files in <filename>/etc/</filename> are
26 reserved for the local administrator, who may use this logic to override the
27 configuration files installed by vendor packages. All configuration files
28 are sorted by their filename in lexicographic order, regardless of which of
29 the directories they reside in. If multiple files specify the same option,
30 the entry in the file with the lexicographically latest name will take
31 precedence. It is recommended to prefix all filenames with a two-digit number
32 and a dash, to simplify the ordering of the files.</para>
33
34 <para>If the administrator wants to disable a configuration file supplied by
35 the vendor, the recommended way is to place a symlink to
36 <filename>/dev/null</filename> in the configuration directory in
37 <filename>/etc/</filename>, with the same filename as the vendor
2ef555d6
JS
38 configuration file. If the vendor configuration file is included in
39 the initrd image, the image has to be regenerated.</para>
d3fae78f
JT
40 </refsection>
41
e93549ef
ZJS
42 <refsection id='main-conf'>
43 <title>Configuration Directories and Precedence</title>
44
a8eaaee7 45 <para>The default configuration is defined during compilation, so a
e93549ef 46 configuration file is only needed when it is necessary to deviate
b938cb90 47 from those defaults. By default, the configuration file in
12b42c76 48 <filename>/etc/systemd/</filename> contains commented out entries
e93549ef
ZJS
49 showing the defaults as a guide to the administrator. This file
50 can be edited to create local overrides.
51 </para>
52
53 <para>When packages need to customize the configuration, they can
54 install configuration snippets in
12b42c76 55 <filename>/usr/lib/systemd/*.conf.d/</filename>. Files in
e93549ef
ZJS
56 <filename>/etc/</filename> are reserved for the local
57 administrator, who may use this logic to override the
58 configuration files installed by vendor packages. The main
59 configuration file is read before any of the configuration
60 directories, and has the lowest precedence; entries in a file in
61 any configuration directory override entries in the single
83fefc88
ZJS
62 configuration file. Files in the <filename>*.conf.d/</filename>
63 configuration subdirectories are sorted by their filename in lexicographic
64 order, regardless of which of the subdirectories they reside in. When
65 multiple files specify the same option, for options which accept just a
66 single value, the entry in the file with the lexicographically latest name
67 takes precedence. For options which accept a list of values, entries are
68 collected as they occur in files sorted lexicographically. It is recommended
69 to prefix all filenames in those subdirectories with a two-digit number and
70 a dash, to simplify the ordering of the files.</para>
e93549ef
ZJS
71
72 <para>To disable a configuration file supplied by the vendor, the
73 recommended way is to place a symlink to
74 <filename>/dev/null</filename> in the configuration directory in
75 <filename>/etc/</filename>, with the same filename as the vendor
76 configuration file.</para>
d3fae78f
JT
77 </refsection>
78</refsection>