]>
Commit | Line | Data |
---|---|---|
514094f9 | 1 | <?xml version="1.0"?> |
bc6fdcbf | 2 | <!DOCTYPE refentry 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 | ||
bc6fdcbf DT |
10 | <refentry> |
11 | <refnamediv> | |
12 | <refname/> | |
13 | <refpurpose/> | |
14 | </refnamediv> | |
af355f19 | 15 | |
bc6fdcbf | 16 | <refsect1 id='confd'> |
d3fae78f JT |
17 | <title>Configuration Directories and Precedence</title> |
18 | ||
e76c60bf ZJS |
19 | <para>Configuration files are read from directories in <filename>/etc/</filename>, |
20 | <filename>/run/</filename>, <filename>/usr/local/lib/</filename>, and <filename>/usr/lib/</filename>, in | |
37b22b3b | 21 | order of precedence, as listed in the SYNOPSIS section above. Files must have the |
e76c60bf ZJS |
22 | <literal>.conf</literal> extension. Files in <filename>/etc/</filename> override files with the same name |
23 | in <filename>/run/</filename>, <filename>/usr/local/lib/</filename>, and | |
24 | <filename>/usr/lib/</filename>. Files in <filename>/run/</filename> override files with the same name | |
25 | under <filename>/usr/</filename>.</para> | |
5ae4336a | 26 | |
e76c60bf ZJS |
27 | <para>All configuration files are sorted by their filename in lexicographic order, regardless of which of |
28 | the directories they reside in. If multiple files specify the same option, the entry in the file with the | |
29 | lexicographically latest name will take precedence. Thus, the configuration in a certain file may either | |
30 | be replaced completely (by placing a file with the same name in a directory with higher priority), or | |
31 | individual settings might be changed (by specifying additional settings in a file with a different name | |
32 | that is ordered later).</para> | |
d3fae78f | 33 | |
e76c60bf ZJS |
34 | <para>Packages should install their configuration files in <filename>/usr/lib/</filename> (distribution |
35 | packages) or <filename>/usr/local/lib/</filename> (local installs). Files in <filename>/etc/</filename> | |
36 | are reserved for the local administrator, who may use this logic to override the configuration files | |
37 | installed by vendor packages. It is recommended to prefix all filenames with a two-digit number and a | |
38 | dash, to simplify the ordering of the files.</para> | |
39 | ||
40 | <para>If the administrator wants to disable a configuration file supplied by the vendor, the recommended | |
41 | way is to place a symlink to <filename>/dev/null</filename> in the configuration directory in | |
42 | <filename>/etc/</filename>, with the same filename as the vendor configuration file. If the vendor | |
43 | configuration file is included in the initrd image, the image has to be regenerated.</para> | |
bc6fdcbf | 44 | </refsect1> |
d3fae78f | 45 | |
bc6fdcbf | 46 | <refsect1 id='main-conf'> |
e93549ef ZJS |
47 | <title>Configuration Directories and Precedence</title> |
48 | ||
a7a18878 | 49 | <para>The default configuration is set during compilation, so configuration is only needed when it is |
c76f2fb0 | 50 | necessary to deviate from those defaults. The main configuration file is either in |
cae6ba72 | 51 | <filename>/usr/lib/systemd/</filename> or <filename>/etc/systemd/</filename> and contains commented out |
c76f2fb0 FB |
52 | entries showing the defaults as a guide to the administrator. Local overrides can be created by creating |
53 | drop-ins, as described below. The main configuration file can also be edited for this purpose (or a copy | |
cae6ba72 | 54 | in <filename>/etc/</filename> if it's shipped in <filename>/usr/</filename>) however using drop-ins for |
c76f2fb0 | 55 | local configuration is recommended over modifications to the main configuration file.</para> |
e93549ef | 56 | |
a7a18878 ZJS |
57 | <para>In addition to the "main" configuration file, drop-in configuration snippets are read from |
58 | <filename>/usr/lib/systemd/*.conf.d/</filename>, <filename>/usr/local/lib/systemd/*.conf.d/</filename>, | |
59 | and <filename>/etc/systemd/*.conf.d/</filename>. Those drop-ins have higher precedence and override the | |
60 | main configuration file. Files in the <filename>*.conf.d/</filename> configuration subdirectories are | |
61 | sorted by their filename in lexicographic order, regardless of in which of the subdirectories they | |
62 | reside. When multiple files specify the same option, for options which accept just a single value, the | |
63 | entry in the file sorted last takes precedence, and for options which accept a list of values, entries | |
64 | are collected as they occur in the sorted files.</para> | |
e76c60bf | 65 | |
a7a18878 ZJS |
66 | <para>When packages need to customize the configuration, they can install drop-ins under |
67 | <filename>/usr/</filename>. Files in <filename>/etc/</filename> are reserved for the local administrator, | |
68 | who may use this logic to override the configuration files installed by vendor packages. Drop-ins have to | |
69 | be used to override package drop-ins, since the main configuration file has lower precedence. It is | |
70 | recommended to prefix all filenames in those subdirectories with a two-digit number and a dash, to | |
c76f2fb0 FB |
71 | simplify the ordering of the files. This also defined a concept of drop-in priority to allow |
72 | distributions to ship drop-ins within a specific range lower than the range used by users. This should | |
73 | lower the risk of package drop-ins overriding accidentally drop-ins defined by users.</para> | |
e93549ef | 74 | |
a7a18878 ZJS |
75 | <para>To disable a configuration file supplied by the vendor, the recommended way is to place a symlink |
76 | to <filename>/dev/null</filename> in the configuration directory in <filename>/etc/</filename>, with the | |
77 | same filename as the vendor configuration file.</para> | |
bc6fdcbf DT |
78 | </refsect1> |
79 | </refentry> |