]>
Commit | Line | Data |
---|---|---|
d3fae78f JT |
1 | <?xml version="1.0"?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*--> |
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+ | |
7 | ||
8 | This file is part of systemd. | |
9 | ||
10 | Copyright 2015 Zbigniew Jędrzejewski-Szmek | |
11 | Copyright 2014 Josh Triplett | |
12 | ||
13 | systemd is free software; you can redistribute it and/or modify it | |
14 | under the terms of the GNU Lesser General Public License as published by | |
15 | the Free Software Foundation; either version 2.1 of the License, or | |
16 | (at your option) any later version. | |
17 | ||
18 | systemd is distributed in the hope that it will be useful, but | |
19 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 | Lesser General Public License for more details. | |
22 | ||
23 | You should have received a copy of the GNU Lesser General Public License | |
24 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
25 | --> | |
26 | ||
d3fae78f JT |
27 | <refsection> |
28 | <refsection id='confd'> | |
29 | <title>Configuration Directories and Precedence</title> | |
30 | ||
31 | <para>Configuration files are read from directories in | |
32 | <filename>/etc/</filename>, <filename>/run/</filename>, and | |
33 | <filename>/usr/lib/</filename>, in order of precedence. | |
34 | Each configuration file in these configuration directories shall be named in | |
35 | the style of <filename><replaceable>filename</replaceable>.conf</filename>. | |
36 | Files in <filename>/etc/</filename> override files with the same name in | |
37 | <filename>/run/</filename> and <filename>/usr/lib/</filename>. Files in | |
38 | <filename>/run/</filename> override files with the same name in | |
39 | <filename>/usr/lib/</filename>.</para> | |
40 | ||
41 | <para>Packages should install their configuration files in | |
42 | <filename>/usr/lib/</filename>. Files in <filename>/etc/</filename> are | |
43 | reserved for the local administrator, who may use this logic to override the | |
44 | configuration files installed by vendor packages. All configuration files | |
45 | are sorted by their filename in lexicographic order, regardless of which of | |
46 | the directories they reside in. If multiple files specify the same option, | |
47 | the entry in the file with the lexicographically latest name will take | |
48 | precedence. It is recommended to prefix all filenames with a two-digit number | |
49 | and a dash, to simplify the ordering of the files.</para> | |
50 | ||
51 | <para>If the administrator wants to disable a configuration file supplied by | |
52 | the vendor, the recommended way is to place a symlink to | |
53 | <filename>/dev/null</filename> in the configuration directory in | |
54 | <filename>/etc/</filename>, with the same filename as the vendor | |
2ef555d6 JS |
55 | configuration file. If the vendor configuration file is included in |
56 | the initrd image, the image has to be regenerated.</para> | |
d3fae78f JT |
57 | </refsection> |
58 | ||
e93549ef ZJS |
59 | <refsection id='main-conf'> |
60 | <title>Configuration Directories and Precedence</title> | |
61 | ||
a8eaaee7 | 62 | <para>The default configuration is defined during compilation, so a |
e93549ef | 63 | configuration file is only needed when it is necessary to deviate |
b938cb90 | 64 | from those defaults. By default, the configuration file in |
12b42c76 | 65 | <filename>/etc/systemd/</filename> contains commented out entries |
e93549ef ZJS |
66 | showing the defaults as a guide to the administrator. This file |
67 | can be edited to create local overrides. | |
68 | </para> | |
69 | ||
70 | <para>When packages need to customize the configuration, they can | |
71 | install configuration snippets in | |
12b42c76 | 72 | <filename>/usr/lib/systemd/*.conf.d/</filename>. Files in |
e93549ef ZJS |
73 | <filename>/etc/</filename> are reserved for the local |
74 | administrator, who may use this logic to override the | |
75 | configuration files installed by vendor packages. The main | |
76 | configuration file is read before any of the configuration | |
77 | directories, and has the lowest precedence; entries in a file in | |
78 | any configuration directory override entries in the single | |
83fefc88 ZJS |
79 | configuration file. Files in the <filename>*.conf.d/</filename> |
80 | configuration subdirectories are sorted by their filename in lexicographic | |
81 | order, regardless of which of the subdirectories they reside in. When | |
82 | multiple files specify the same option, for options which accept just a | |
83 | single value, the entry in the file with the lexicographically latest name | |
84 | takes precedence. For options which accept a list of values, entries are | |
85 | collected as they occur in files sorted lexicographically. It is recommended | |
86 | to prefix all filenames in those subdirectories with a two-digit number and | |
87 | a dash, to simplify the ordering of the files.</para> | |
e93549ef ZJS |
88 | |
89 | <para>To disable a configuration file supplied by the vendor, the | |
90 | recommended way is to place a symlink to | |
91 | <filename>/dev/null</filename> in the configuration directory in | |
92 | <filename>/etc/</filename>, with the same filename as the vendor | |
93 | configuration file.</para> | |
d3fae78f JT |
94 | </refsection> |
95 | </refsection> |