Skip to content

Commit 7b529bf

Browse files
keszybzbluca
authored andcommitted
man: document that separate /usr/local/ must not be used for config
Since we document /usr/local/lib/systemd/ and other paths for various things, add notes that this is not supported if /usr/local is a separate partition. In systemd.unit, I tried to add the footnote in the table where /usr/local/lib/systemd/ is listed, but that get's rendered as '[sup]a[/sup]' with a mangled footnote at the bottom of the table :( . Also, split paragraphs in one place where the subject changes without any transition. Follow-up for 02f35b1. Replaces systemd/systemd#33231.
1 parent 835fbe5 commit 7b529bf

File tree

6 files changed

+55
-33
lines changed

6 files changed

+55
-33
lines changed

man/standard-conf.xml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Copyright © 2014 Josh Triplett
88
-->
99

10-
<refentry>
10+
<refentry xmlns:xi="http://www.w3.org/2001/XInclude">
1111
<refnamediv>
1212
<refname/>
1313
<refpurpose/>
@@ -32,13 +32,16 @@
3232
that is ordered later).</para>
3333

3434
<para>Packages should install their configuration files in <filename>/usr/lib/</filename> (distribution
35-
packages) or <filename>/usr/local/lib/</filename> (local installs). Files in <filename>/etc/</filename>
36-
are reserved for the local administrator, who may use this logic to override the configuration files
37-
installed by vendor packages. It is recommended to prefix all filenames with a two-digit number and a
38-
dash, to simplify the ordering of the files. It is recommended to use the range 10-40 for configuration
39-
files in <filename>/usr/</filename> and the range 60-90 for configuration files in
40-
<filename>/etc/</filename> and <filename>/run/</filename>, to make sure that local and transient
41-
configuration files will always take priority over configuration files shipped by the OS vendor.</para>
35+
packages) or <filename>/usr/local/lib/</filename> (local installs)
36+
<xi:include xpointer="usr-local-footnote" />.
37+
Files in <filename>/etc/</filename> are reserved for the local administrator, who may use this logic to
38+
override the configuration files installed by vendor packages.</para>
39+
40+
<para>It is recommended to prefix all filenames with a two-digit number and a dash to simplify the
41+
ordering. It is recommended to use the range 10-40 for configuration files in <filename>/usr/</filename>
42+
and the range 60-90 for configuration files in <filename>/etc/</filename> and <filename>/run/</filename>,
43+
to make sure that local and transient configuration files will always take priority over configuration
44+
files shipped by the OS vendor.</para>
4245

4346
<para>If the administrator wants to disable a configuration file supplied by the vendor, the recommended
4447
way is to place a symlink to <filename>/dev/null</filename> in the configuration directory in
@@ -54,7 +57,7 @@
5457
listed directories in order of priority, only the first file found is used:
5558
<filename>/etc/systemd/</filename>,
5659
<filename>/run/systemd/</filename>,
57-
<filename>/usr/local/lib/systemd/</filename>,
60+
<filename>/usr/local/lib/systemd/</filename> <xi:include xpointer="usr-local-footnote" />,
5861
<filename>/usr/lib/systemd/</filename>.
5962
The vendor version of the file contains commented out entries showing the defaults as a guide to the
6063
administrator. Local overrides can also be created by creating drop-ins, as described below. The main
@@ -76,15 +79,28 @@
7679
who may use this logic to override the configuration files installed by vendor packages. Drop-ins have to
7780
be used to override package drop-ins, since the main configuration file has lower precedence. It is
7881
recommended to prefix all filenames in those subdirectories with a two-digit number and a dash, to
79-
simplify the ordering of the files. This also defines a concept of drop-in priorities to allow
80-
OS vendors to ship drop-ins within a specific range lower than the range used by users. This should
81-
lower the risk of package drop-ins overriding accidentally drop-ins defined by users. It is recommended
82-
to use the range 10-40 for drop-ins in <filename>/usr/</filename> and the range 60-90 for drop-ins in
82+
simplify the ordering. This also defines a concept of drop-in priorities to allow OS vendors to ship
83+
drop-ins within a specific range lower than the range used by users. This should lower the risk of
84+
package drop-ins overriding accidentally drop-ins defined by users. It is recommended to use the range
85+
10-40 for drop-ins in <filename>/usr/</filename> and the range 60-90 for drop-ins in
8386
<filename>/etc/</filename> and <filename>/run/</filename>, to make sure that local and transient drop-ins
8487
take priority over drop-ins shipped by the OS vendor.</para>
8588

8689
<para>To disable a configuration file supplied by the vendor, the recommended way is to place a symlink
8790
to <filename>/dev/null</filename> in the configuration directory in <filename>/etc/</filename>, with the
8891
same filename as the vendor configuration file.</para>
8992
</refsect1>
93+
94+
<refsect1>
95+
<title>Extras</title>
96+
97+
<para><filename>/usr/local/lib/systemd</filename>
98+
<footnote id='usr-local-footnote'>
99+
<para>💣💥🧨💥💥💣 Please note that those configuration files must be available at all times. If
100+
<filename>/usr/local/</filename> is a separate partition, it may not be available during early boot,
101+
and must not be used for configuration.</para>
102+
</footnote>
103+
</para>
104+
</refsect1>
105+
90106
</refentry>

man/systemd.environment-generator.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@
6161
above. System and user environment generators are loaded from directories with names ending in
6262
<filename>system-environment-generators/</filename> and
6363
<filename>user-environment-generators/</filename>, respectively. Generators found in directories
64-
listed earlier override the ones with the same name in directories lower in the list. A symlink
65-
to <filename>/dev/null</filename> or an empty file can be used to mask a generator, thereby
66-
preventing it from running. Please note that the order of the two directories with the highest
67-
priority is reversed with respect to the unit load path, and generators in
68-
<filename>/run/</filename> overwrite those in <filename>/etc/</filename>.</para>
64+
listed earlier override the ones with the same name in directories lower in the list
65+
<xi:include href="standard-conf.xml" xpointer="usr-local-footnote" />.
66+
A symlink to <filename>/dev/null</filename> or an empty file can be used to mask a generator,
67+
thereby preventing it from running. Please note that the order of the two directories with the highest
68+
priority is reversed with respect to the unit load path, and generators in <filename>/run/</filename>
69+
overwrite those in <filename>/etc/</filename>.</para>
6970

7071
<para>After installing new generators or updating the configuration, <command>systemctl
7172
daemon-reload</command> may be executed. This will re-run all generators, updating environment

man/systemd.generator.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@
7777
and user generators are loaded from directories with names ending in
7878
<filename>system-generators/</filename> and <filename>user-generators/</filename>,
7979
respectively. Generators found in directories listed earlier override the ones with the same name in
80-
directories lower in the list. A symlink to <filename>/dev/null</filename> or an empty file can be used
81-
to mask a generator, thereby preventing it from running. Please note that the order of the two
82-
directories with the highest priority is reversed with respect to the unit load path, and generators in
83-
<filename>/run/</filename> overwrite those in <filename>/etc/</filename>.</para>
80+
directories lower in the list <xi:include href="standard-conf.xml" xpointer="usr-local-footnote" />.
81+
A symlink to <filename>/dev/null</filename> or an empty file can be used to mask a generator, thereby
82+
preventing it from running. Please note that the order of the two directories with the highest priority
83+
is reversed with respect to the unit load path, and generators in <filename>/run/</filename> overwrite
84+
those in <filename>/etc/</filename>.</para>
8485

8586
<para>After installing new generators or updating the configuration, <command>systemctl
8687
daemon-reload</command> may be executed. This will delete the previous configuration created by

man/systemd.link.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535

3636
<para>The <filename>.link</filename> files are read from the files located in the system network
3737
directory <filename>/usr/lib/systemd/network</filename> and
38-
<filename>/usr/local/lib/systemd/network</filename>, the volatile runtime network directory
38+
<filename>/usr/local/lib/systemd/network</filename>
39+
<xi:include href="standard-conf.xml" xpointer="usr-local-footnote" />,
40+
the volatile runtime network directory
3941
<filename>/run/systemd/network</filename>, and the local administration network directory
4042
<filename>/etc/systemd/network</filename>. All configuration files are collectively sorted and
4143
processed in alphanumeric order, regardless of the directories in which they live. However, files

man/systemd.network.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@
3939

4040
<para>The <filename>.network</filename> files are read from the files located in the system network
4141
directories <filename>/usr/lib/systemd/network</filename> and
42-
<filename>/usr/local/lib/systemd/network</filename>, the volatile runtime network directory
43-
<filename>/run/systemd/network</filename> and the local administration network directory
44-
<filename>/etc/systemd/network</filename>. All configuration files are collectively sorted and
45-
processed in alphanumeric order, regardless of the directories in which they live. However, files
46-
with identical filenames replace each other. It is recommended that each filename is prefixed with
47-
a number smaller than <literal>70</literal> (e.g. <filename>10-eth0.network</filename>). Otherwise, the
48-
default <filename>.network</filename> files or those generated by
42+
<filename>/usr/local/lib/systemd/network</filename>
43+
<xi:include href="standard-conf.xml" xpointer="usr-local-footnote" />,
44+
the volatile runtime network directory <filename>/run/systemd/network</filename> and the local
45+
administration network directory <filename>/etc/systemd/network</filename>. All configuration files are
46+
collectively sorted and processed in alphanumeric order, regardless of the directories in which they
47+
live. However, files with identical filenames replace each other. It is recommended that each filename is
48+
prefixed with a number smaller than <literal>70</literal> (e.g. <filename>10-eth0.network</filename>).
49+
Otherwise, the default <filename>.network</filename> files or those generated by
4950
<citerefentry><refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
5051
may take precedence over user configured files. Files in <filename>/etc/</filename> have the highest
5152
priority, files in <filename>/run/</filename> take precedence over files with the same name under

man/systemd.unit.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,9 @@
353353
<para>Unit files are loaded from a set of paths determined during
354354
compilation, described in the two tables below. Unit files found
355355
in directories listed earlier override files with the same name in
356-
directories lower in the list.</para>
356+
directories lower in the list
357+
<xi:include href="standard-conf.xml" xpointer="usr-local-footnote" />.
358+
</para>
357359

358360
<para>When the variable <varname>$SYSTEMD_UNIT_PATH</varname> is set,
359361
the contents of this variable overrides the unit load path. If
@@ -407,7 +409,7 @@
407409
</row>
408410
<row>
409411
<entry><filename>/usr/local/lib/systemd/system</filename></entry>
410-
<entry>System units installed by the administrator </entry>
412+
<entry>System units installed by the administrator</entry>
411413
</row>
412414
<row>
413415
<entry><filename>/usr/lib/systemd/system</filename></entry>
@@ -2687,5 +2689,4 @@ OnFailure=failure-handler@%N.service
26872689
<member><citerefentry project='man-pages'><refentrytitle>uname</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
26882690
</simplelist></para>
26892691
</refsect1>
2690-
26912692
</refentry>

0 commit comments

Comments
 (0)