]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/standard-conf.xml
man: drop mode line in file headers
[thirdparty/systemd.git] / man / standard-conf.xml
1 <?xml version="1.0"?>
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 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7 Copyright © 2014 Josh Triplett
8 -->
9
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
38 configuration file. If the vendor configuration file is included in
39 the initrd image, the image has to be regenerated.</para>
40 </refsection>
41
42 <refsection id='main-conf'>
43 <title>Configuration Directories and Precedence</title>
44
45 <para>The default configuration is defined during compilation, so a
46 configuration file is only needed when it is necessary to deviate
47 from those defaults. By default, the configuration file in
48 <filename>/etc/systemd/</filename> contains commented out entries
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
55 <filename>/usr/lib/systemd/*.conf.d/</filename>. Files in
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
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>
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>
77 </refsection>
78 </refsection>