]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/standard-conf.xml
Merge pull request #9116 from poettering/tmpfiles-tmp-var-tmp
[thirdparty/systemd.git] / man / standard-conf.xml
CommitLineData
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
f48f7543
ZJS
12-->
13
d3fae78f
JT
14<refsection>
15 <refsection id='confd'>
16 <title>Configuration Directories and Precedence</title>
17
18 <para>Configuration files are read from directories in
19 <filename>/etc/</filename>, <filename>/run/</filename>, and
20 <filename>/usr/lib/</filename>, in order of precedence.
21 Each configuration file in these configuration directories shall be named in
22 the style of <filename><replaceable>filename</replaceable>.conf</filename>.
23 Files in <filename>/etc/</filename> override files with the same name in
24 <filename>/run/</filename> and <filename>/usr/lib/</filename>. Files in
25 <filename>/run/</filename> override files with the same name in
26 <filename>/usr/lib/</filename>.</para>
27
28 <para>Packages should install their configuration files in
29 <filename>/usr/lib/</filename>. Files in <filename>/etc/</filename> are
30 reserved for the local administrator, who may use this logic to override the
31 configuration files installed by vendor packages. All configuration files
32 are sorted by their filename in lexicographic order, regardless of which of
33 the directories they reside in. If multiple files specify the same option,
34 the entry in the file with the lexicographically latest name will take
35 precedence. It is recommended to prefix all filenames with a two-digit number
36 and a dash, to simplify the ordering of the files.</para>
37
38 <para>If the administrator wants to disable a configuration file supplied by
39 the vendor, the recommended way is to place a symlink to
40 <filename>/dev/null</filename> in the configuration directory in
41 <filename>/etc/</filename>, with the same filename as the vendor
2ef555d6
JS
42 configuration file. If the vendor configuration file is included in
43 the initrd image, the image has to be regenerated.</para>
d3fae78f
JT
44 </refsection>
45
e93549ef
ZJS
46 <refsection id='main-conf'>
47 <title>Configuration Directories and Precedence</title>
48
a8eaaee7 49 <para>The default configuration is defined during compilation, so a
e93549ef 50 configuration file is only needed when it is necessary to deviate
b938cb90 51 from those defaults. By default, the configuration file in
12b42c76 52 <filename>/etc/systemd/</filename> contains commented out entries
e93549ef
ZJS
53 showing the defaults as a guide to the administrator. This file
54 can be edited to create local overrides.
55 </para>
56
57 <para>When packages need to customize the configuration, they can
58 install configuration snippets in
12b42c76 59 <filename>/usr/lib/systemd/*.conf.d/</filename>. Files in
e93549ef
ZJS
60 <filename>/etc/</filename> are reserved for the local
61 administrator, who may use this logic to override the
62 configuration files installed by vendor packages. The main
63 configuration file is read before any of the configuration
64 directories, and has the lowest precedence; entries in a file in
65 any configuration directory override entries in the single
83fefc88
ZJS
66 configuration file. Files in the <filename>*.conf.d/</filename>
67 configuration subdirectories are sorted by their filename in lexicographic
68 order, regardless of which of the subdirectories they reside in. When
69 multiple files specify the same option, for options which accept just a
70 single value, the entry in the file with the lexicographically latest name
71 takes precedence. For options which accept a list of values, entries are
72 collected as they occur in files sorted lexicographically. It is recommended
73 to prefix all filenames in those subdirectories with a two-digit number and
74 a dash, to simplify the ordering of the files.</para>
e93549ef
ZJS
75
76 <para>To disable a configuration file supplied by the vendor, the
77 recommended way is to place a symlink to
78 <filename>/dev/null</filename> in the configuration directory in
79 <filename>/etc/</filename>, with the same filename as the vendor
80 configuration file.</para>
d3fae78f
JT
81 </refsection>
82</refsection>