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