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