chiark / gitweb /
man: Factor out a common snippet for .d directories and precedence
authorJosh Triplett <josh@joshtriplett.org>
Sat, 29 Nov 2014 09:05:43 +0000 (01:05 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 29 Nov 2014 18:55:31 +0000 (13:55 -0500)
Several manpages contain duplicate text describing a standard set of .d
configuration directories, with the usual sorting, precedence,
overrides, and so on.  Factor this common text out using XInclude before
proliferating it even further.

Makefile-man.am
man/binfmt.d.xml
man/logind.conf.xml
man/modules-load.d.xml
man/standard-conf.xml [new file with mode: 0644]
man/sysctl.d.xml
man/sysusers.d.xml

index 906a968..c24606a 100644 (file)
@@ -1638,6 +1638,7 @@ EXTRA_DIST += \
        man/sd_uid_get_state.xml \
        man/sd_watchdog_enabled.xml \
        man/shutdown.xml \
+       man/standard-conf.xml \
        man/standard-options.xml \
        man/sysctl.d.xml \
        man/systemctl.xml \
index 2270166..55a3df0 100644 (file)
@@ -19,7 +19,8 @@
   You should have received a copy of the GNU Lesser General Public License
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
-<refentry id="binfmt.d" conditional='ENABLE_BINFMT'>
+<refentry id="binfmt.d" conditional='ENABLE_BINFMT'
+          xmlns:xi="http://www.w3.org/2001/XInclude">
 
         <refentryinfo>
                 <title>binfmt.d</title>
                 <para>Empty lines and lines beginning with ; and # are
                 ignored. Note that this means you may not use ; and #
                 as delimiter in binary format rules.</para>
-
-                <para>Each configuration file shall be named in the
-                style of <filename><replaceable>program</replaceable>.conf</filename>.
-                Files in <filename>/etc/</filename> override files
-                with the same name in <filename>/usr/lib/</filename>
-                and <filename>/run/</filename>. Files in
-                <filename>/run/</filename> override files with the
-                same name in <filename>/usr/lib/</filename>. Packages
-                should install their configuration files in
-                <filename>/usr/lib/</filename>, files in
-                <filename>/etc/</filename> are reserved for the local
-                administrator, who may use this logic to override the
-                configuration files installed from vendor
-                packages. All files are sorted by their filename in
-                lexicographic order, regardless of which of the
-                directories they reside in. If multiple files specify
-                the same binary type name, the entry in the file with
-                the lexicographically latest name will be applied.</para>
-
-                <para>If the administrator wants to disable a
-                configuration file supplied by the vendor, the
-                recommended way is to place a symlink to
-                <filename>/dev/null</filename> in
-                <filename>/etc/binfmt.d/</filename> bearing the
-                same filename.</para>
         </refsect1>
 
+        <xi:include href="standard-conf.xml" xpointer="confd" />
+
         <refsect1>
                 <title>Example</title>
                 <example>
index ca7525f..e927cf4 100644 (file)
@@ -22,7 +22,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
 
-<refentry id="logind.conf" conditional='ENABLE_LOGIND'>
+<refentry id="logind.conf" conditional='ENABLE_LOGIND'
+          xmlns:xi="http://www.w3.org/2001/XInclude">
         <refentryinfo>
                 <title>logind.conf</title>
                 <productname>systemd</productname>
                 <title>Description</title>
 
                 <para>These files configure various parameters of the systemd login manager, <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
-
-                <para>Each configuration file shall be named in the style of
-                <filename><replaceable>filename</replaceable>.conf</filename>.
-                Files in <filename>/etc/</filename> override files with the
-                same name in <filename>/usr/lib/</filename> and
-                <filename>/run/</filename>.  Files in
-                <filename>/run/</filename> override files with the same name in
-                <filename>/usr/lib/</filename>. Packages should install their
-                configuration files in <filename>/usr/lib/</filename>. Files in
-                <filename>/etc/</filename> are reserved for the local
-                administrator, who may use this logic to override the
-                configuration files installed by vendor packages. All
-                configuration files are sorted by their filename in
-                lexicographic order, regardless of which of the directories
-                they reside in. If multiple files specify the same option, the
-                entry in the file with the lexicographically latest name will
-                be applied; entries in any <filename>logind.conf.d</filename>
-                file override entries in
-                <filename>/etc/systemd/logind.conf</filename>. It is
-                recommended to prefix all filenames with a two-digit number and
-                a dash, to simplify the ordering of the files.</para>
         </refsect1>
 
+        <xi:include href="standard-conf.xml" xpointer="confd" />
+        <xi:include href="standard-conf.xml" xpointer="conf" />
+
         <refsect1>
                 <title>Options</title>
 
index 33c466f..4b578d7 100644 (file)
@@ -19,7 +19,8 @@
   You should have received a copy of the GNU Lesser General Public License
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
-<refentry id="modules-load.d" conditional='HAVE_KMOD'>
+<refentry id="modules-load.d" conditional='HAVE_KMOD'
+          xmlns:xi="http://www.w3.org/2001/XInclude">
 
         <refentryinfo>
                 <title>modules-load.d</title>
                 list of kernel module names to load, separated by
                 newlines. Empty lines and lines whose first
                 non-whitespace character is # or ; are ignored.</para>
-
-                <para>Each configuration file shall be named in the
-                style of <filename><replaceable>program</replaceable>.conf</filename>.
-                Files in <filename>/etc/</filename> override files
-                with the same name in <filename>/usr/lib/</filename>
-                and <filename>/run/</filename>. Files in
-                <filename>/run/</filename> override files with the
-                same name in <filename>/usr/lib/</filename>. Packages
-                should install their configuration files in
-                <filename>/usr/lib/</filename>, files in
-                <filename>/etc/</filename> are reserved for the local
-                administrator, who may use this logic to override the
-                configuration files installed from vendor
-                packages.</para>
-
-                <para>If the administrator wants to disable a
-                configuration file supplied by the vendor, the
-                recommended way is to place a symlink to
-                <filename>/dev/null</filename> in
-                <filename>/etc/modules-load.d/</filename> bearing the
-                same filename.</para>
         </refsect1>
 
+        <xi:include href="standard-conf.xml" xpointer="confd" />
+
         <refsect1>
                 <title>Example</title>
                 <example>
diff --git a/man/standard-conf.xml b/man/standard-conf.xml
new file mode 100644 (file)
index 0000000..b87d7e9
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0"?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
+<!DOCTYPE refsection PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+          "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<refsection>
+  <refsection id='confd'>
+    <title>Configuration Directories and Precedence</title>
+
+    <para>Configuration files are read from directories in
+    <filename>/etc/</filename>, <filename>/run/</filename>, and
+    <filename>/usr/lib/</filename>, in order of precedence.
+    Each configuration file in these configuration directories shall be named in
+    the style of <filename><replaceable>filename</replaceable>.conf</filename>.
+    Files in <filename>/etc/</filename> override files with the same name in
+    <filename>/run/</filename> and <filename>/usr/lib/</filename>. Files in
+    <filename>/run/</filename> override files with the same name in
+    <filename>/usr/lib/</filename>.</para>
+
+    <para>Packages should install their configuration files in
+    <filename>/usr/lib/</filename>. Files in <filename>/etc/</filename> are
+    reserved for the local administrator, who may use this logic to override the
+    configuration files installed by vendor packages. All configuration files
+    are sorted by their filename in lexicographic order, regardless of which of
+    the directories they reside in. If multiple files specify the same option,
+    the entry in the file with the lexicographically latest name will take
+    precedence. It is recommended to prefix all filenames with a two-digit number
+    and a dash, to simplify the ordering of the files.</para>
+
+    <para>If the administrator wants to disable a configuration file supplied by
+    the vendor, the recommended way is to place a symlink to
+    <filename>/dev/null</filename> in the configuration directory in
+    <filename>/etc/</filename>, with the same filename as the vendor
+    configuration file.</para>
+  </refsection>
+
+  <refsection id='conf'>
+    <title>Configuration File</title>
+
+    <para>Configuration is also read from a single configuration file in
+    <filename>/etc/</filename>. This file is read before any of the
+    configuration directories, and has the lowest precedence; entries in a file
+    in any configuration directory override entries in the single configuration
+    file.</para>
+  </refsection>
+</refsection>
index 922b5c4..c67a199 100644 (file)
@@ -18,7 +18,8 @@
   You should have received a copy of the GNU Lesser General Public License
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
-<refentry id="sysctl.d">
+<refentry id="sysctl.d"
+          xmlns:xi="http://www.w3.org/2001/XInclude">
 
         <refentryinfo>
                 <title>sysctl.d</title>
                 is <literal>#</literal> or <literal>;</literal> are
                 ignored.</para>
 
-                <para>Each configuration file shall be named in the
-                style of <filename><replaceable>program</replaceable>.conf</filename>.
-                Files in <filename>/etc/</filename> override files
-                with the same name in <filename>/usr/lib/</filename>
-                and <filename>/run/</filename>.  Files in
-                <filename>/run/</filename> override files with the same
-                name in <filename>/usr/lib/</filename>. Packages
-                should install their configuration files in
-                <filename>/usr/lib/</filename>. Files in
-                <filename>/etc/</filename> are reserved for the local
-                administrator, who may use this logic to override the
-                configuration files installed by vendor packages. All
-                configuration files are sorted by their filename in
-                lexicographic order, regardless of which of the
-                directories they reside in. If multiple files specify the
-                same variable name, the entry in the file with the
-                lexicographically latest name will be applied. It is
-                recommended to prefix all filenames with a two-digit
-                number and a dash, to simplify the ordering of the
-                files.</para>
-
                 <para>Note that either <literal>/</literal> or
                 <literal>.</literal> may be used as separators within
                 sysctl variable names. If the first separator is a
                 <filename>/proc/sys/net/ipv4/conf/enp3s0.200/forwarding</filename>.
                 </para>
 
-                <para>If the administrator wants to disable a
-                configuration file supplied by the vendor, the
-                recommended way is to place a symlink to
-                <filename>/dev/null</filename> in
-                <filename>/etc/sysctl.d/</filename> bearing the
-                same filename.</para>
-
                 <para>The settings configured with
                 <filename>sysctl.d</filename> files will be applied
                 early on boot. The network interface-specific options
                 example below).</para>
         </refsect1>
 
+        <xi:include href="standard-conf.xml" xpointer="confd" />
+
         <refsect1>
                 <title>Examples</title>
                 <example>
index 18c71db..ac2db98 100644 (file)
@@ -19,7 +19,8 @@
   You should have received a copy of the GNU Lesser General Public License
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
-<refentry id="sysusers.d">
+<refentry id="sysusers.d"
+          xmlns:xi="http://www.w3.org/2001/XInclude">
 
         <refentryinfo>
                 <title>sysusers.d</title>
@@ -239,8 +240,10 @@ u root 0 "Superuser" /root</programlisting>
 
         </refsect1>
 
+        <xi:include href="standard-conf.xml" xpointer="confd" />
+
         <refsect1>
-                <title>Overriding vendor configuration</title>
+                <title>Idempotence</title>
 
                 <para>Note that <command>systemd-sysusers</command>
                 will do nothing if the specified users or groups
@@ -248,31 +251,13 @@ u root 0 "Superuser" /root</programlisting>
                 <filename>sysusers.d</filename> vendor configuration,
                 except to block certain users or groups from being
                 created.</para>
-
-                <para>Files in <filename>/etc/sysusers.d</filename>
-                override files with the same name in
-                <filename>/usr/lib/sysusers.d</filename> and
-                <filename>/run/sysusers.d</filename>. Files in
-                <filename>/run/sysusers.d</filename> override files
-                with the same name in
-                <filename>/usr/lib/sysusers.d</filename>. The scheme is the same as for
-                <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
-                except for the directory name.</para>
-
-                <para>If the administrator wants to disable a
-                configuration file supplied by the vendor, the
-                recommended way is to place a symlink to
-                <filename>/dev/null</filename> in
-                <filename>/etc/sysusers.d/</filename> bearing the
-                same filename.</para>
         </refsect1>
 
         <refsect1>
                 <title>See Also</title>
                 <para>
                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-                        <citerefentry><refentrytitle>systemd-sysusers</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-                        <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+                        <citerefentry><refentrytitle>systemd-sysusers</refentrytitle><manvolnum>8</manvolnum></citerefentry>
                 </para>
         </refsect1>