]>
Commit | Line | Data |
---|---|---|
f47781d8 MP |
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" | |
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> | |
4 | ||
5 | <refsection> | |
6 | <refsection id='confd'> | |
7 | <title>Configuration Directories and Precedence</title> | |
8 | ||
9 | <para>Configuration files are read from directories in | |
10 | <filename>/etc/</filename>, <filename>/run/</filename>, and | |
11 | <filename>/usr/lib/</filename>, in order of precedence. | |
12 | Each configuration file in these configuration directories shall be named in | |
13 | the style of <filename><replaceable>filename</replaceable>.conf</filename>. | |
14 | Files in <filename>/etc/</filename> override files with the same name in | |
15 | <filename>/run/</filename> and <filename>/usr/lib/</filename>. Files in | |
16 | <filename>/run/</filename> override files with the same name in | |
17 | <filename>/usr/lib/</filename>.</para> | |
18 | ||
19 | <para>Packages should install their configuration files in | |
20 | <filename>/usr/lib/</filename>. Files in <filename>/etc/</filename> are | |
21 | reserved for the local administrator, who may use this logic to override the | |
22 | configuration files installed by vendor packages. All configuration files | |
23 | are sorted by their filename in lexicographic order, regardless of which of | |
24 | the directories they reside in. If multiple files specify the same option, | |
25 | the entry in the file with the lexicographically latest name will take | |
26 | precedence. It is recommended to prefix all filenames with a two-digit number | |
27 | and a dash, to simplify the ordering of the files.</para> | |
28 | ||
29 | <para>If the administrator wants to disable a configuration file supplied by | |
30 | the vendor, the recommended way is to place a symlink to | |
31 | <filename>/dev/null</filename> in the configuration directory in | |
32 | <filename>/etc/</filename>, with the same filename as the vendor | |
d9dfd233 MP |
33 | configuration file. If the vendor configuration file is included in |
34 | the initrd image, the image has to be regenerated.</para> | |
35 | ||
f47781d8 MP |
36 | </refsection> |
37 | ||
e3bff60a MP |
38 | <refsection id='main-conf'> |
39 | <title>Configuration Directories and Precedence</title> | |
40 | ||
41 | <para>Default configuration is defined during compilation, so a | |
42 | configuration file is only needed when it is necessary to deviate | |
43 | from those defaults. By default the configuration file in | |
44 | <filename>/etc/systemd/</filename> contains commented out entries | |
45 | showing the defaults as a guide to the administrator. This file | |
46 | can be edited to create local overrides. | |
47 | </para> | |
48 | ||
49 | <para>When packages need to customize the configuration, they can | |
50 | install configuration snippets in | |
51 | <filename>/usr/lib/systemd/*.conf.d/</filename>. Files in | |
52 | <filename>/etc/</filename> are reserved for the local | |
53 | administrator, who may use this logic to override the | |
54 | configuration files installed by vendor packages. The main | |
55 | configuration file is read before any of the configuration | |
56 | directories, and has the lowest precedence; entries in a file in | |
57 | any configuration directory override entries in the single | |
58 | configuration file. Files in the | |
59 | <filename>*.conf.d/</filename> configuration subdirectories | |
60 | are sorted by their filename in lexicographic order, regardless of | |
61 | which of the subdirectories they reside in. If multiple files | |
62 | specify the same option, the entry in the file with the | |
63 | lexicographically latest name takes precedence. It is recommended | |
64 | to prefix all filenames in those subdirectories with a two-digit | |
65 | number and a dash, to simplify the ordering of the files.</para> | |
66 | ||
67 | <para>To disable a configuration file supplied by the vendor, the | |
68 | recommended way is to place a symlink to | |
69 | <filename>/dev/null</filename> in the configuration directory in | |
70 | <filename>/etc/</filename>, with the same filename as the vendor | |
71 | configuration file.</para> | |
f47781d8 MP |
72 | </refsection> |
73 | </refsection> |