]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/standard-conf.xml
libudev: rescan devices when filter is updated
[thirdparty/systemd.git] / man / standard-conf.xml
CommitLineData
514094f9 1<?xml version="1.0"?>
d3fae78f 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+
96b2fb93 7 Copyright © 2014 Josh Triplett
f48f7543
ZJS
8-->
9
d3fae78f
JT
10<refsection>
11 <refsection id='confd'>
12 <title>Configuration Directories and Precedence</title>
13
5ae4336a
ZJS
14 <para>Configuration files are read from directories in <filename>/etc/</filename>, <filename>/run/</filename>,
15 <filename>/usr/local/lib/</filename>, and <filename>/usr/lib/</filename>, in order of precedence. Each
16 configuration file in these configuration directories shall be named in the style of
17 <filename><replaceable>filename</replaceable>.conf</filename>. Files in <filename>/etc/</filename> override files
18 with the same name in <filename>/run/</filename>, <filename>/usr/local/lib/</filename>, and
19 <filename>/usr/lib/</filename>. Files in <filename>/run/</filename> override files with the same name under
20 <filename>/usr/</filename>.</para>
21
22 <para>Packages should install their configuration files in <filename>/usr/lib/</filename> (distribution packages)
23 or <filename>/usr/local/lib/</filename> (local installs). Files in <filename>/etc/</filename> are
d3fae78f
JT
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
2ef555d6
JS
36 configuration file. If the vendor configuration file is included in
37 the initrd image, the image has to be regenerated.</para>
d3fae78f
JT
38 </refsection>
39
e93549ef
ZJS
40 <refsection id='main-conf'>
41 <title>Configuration Directories and Precedence</title>
42
a8eaaee7 43 <para>The default configuration is defined during compilation, so a
e93549ef 44 configuration file is only needed when it is necessary to deviate
b938cb90 45 from those defaults. By default, the configuration file in
12b42c76 46 <filename>/etc/systemd/</filename> contains commented out entries
e93549ef
ZJS
47 showing the defaults as a guide to the administrator. This file
48 can be edited to create local overrides.
49 </para>
50
51 <para>When packages need to customize the configuration, they can
52 install configuration snippets in
5ae4336a
ZJS
53 <filename>/usr/lib/systemd/*.conf.d/</filename> or
54 <filename>/usr/local/lib/systemd/*.conf.d/</filename>. Files in
e93549ef
ZJS
55 <filename>/etc/</filename> are reserved for the local
56 administrator, who may use this logic to override the
57 configuration files installed by vendor packages. The main
58 configuration file is read before any of the configuration
59 directories, and has the lowest precedence; entries in a file in
60 any configuration directory override entries in the single
83fefc88
ZJS
61 configuration file. Files in the <filename>*.conf.d/</filename>
62 configuration subdirectories are sorted by their filename in lexicographic
63 order, regardless of which of the subdirectories they reside in. When
64 multiple files specify the same option, for options which accept just a
65 single value, the entry in the file with the lexicographically latest name
66 takes precedence. For options which accept a list of values, entries are
67 collected as they occur in files sorted lexicographically. It is recommended
68 to prefix all filenames in those subdirectories with a two-digit number and
69 a dash, to simplify the ordering of the files.</para>
e93549ef
ZJS
70
71 <para>To disable a configuration file supplied by the vendor, the
72 recommended way is to place a symlink to
73 <filename>/dev/null</filename> in the configuration directory in
74 <filename>/etc/</filename>, with the same filename as the vendor
75 configuration file.</para>
d3fae78f
JT
76 </refsection>
77</refsection>