803fb7
From b72201257216f687bf3462ad7539612cccbbce75 Mon Sep 17 00:00:00 2001
803fb7
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
803fb7
Date: Tue, 3 Mar 2015 19:10:21 -0500
803fb7
Subject: [PATCH] Do not advertise .d snippets over main config file
803fb7
803fb7
For daemons which have a main configuration file, there's
803fb7
little reason for the administrator to use configuration snippets.
803fb7
They are useful for packagers which need to override settings, but
803fb7
we shouldn't advertise that as the main way of configuring those
803fb7
services.
803fb7
803fb7
https://bugs.freedesktop.org/show_bug.cgi?id=89397
803fb7
(cherry picked from commit e93549ef29c4123d9ee45acb5815048390201e49)
803fb7
---
803fb7
 man/bootchart.conf.xml         |  3 +--
803fb7
 man/coredump.conf.xml          |  3 +--
803fb7
 man/journald.conf.xml          |  3 +--
de8967
 man/logind.conf.xml            |  8 ++++---
803fb7
 man/resolved.conf.xml          |  3 +--
de8967
 man/standard-conf.xml          | 42 +++++++++++++++++++++++++++-------
803fb7
 man/systemd-sleep.conf.xml     |  3 +--
803fb7
 man/systemd-system.conf.xml    |  3 +--
803fb7
 man/timesyncd.conf.xml         |  3 +--
de8967
 src/bootchart/bootchart.conf   |  7 +++---
de8967
 src/core/system.conf           |  7 +++---
de8967
 src/journal/coredump.conf      |  7 +++---
de8967
 src/journal/journald.conf      |  7 +++---
de8967
 src/login/logind.conf          |  7 +++---
de8967
 src/resolve/resolved.conf.in   |  5 ++--
de8967
 src/timesync/timesyncd.conf.in |  7 +++---
803fb7
 16 files changed, 73 insertions(+), 45 deletions(-)
803fb7
803fb7
diff --git a/man/bootchart.conf.xml b/man/bootchart.conf.xml
803fb7
index 8d9700d30..bf6ca0bf9 100644
803fb7
--- a/man/bootchart.conf.xml
803fb7
+++ b/man/bootchart.conf.xml
803fb7
@@ -68,8 +68,7 @@
803fb7
     parameters and graph output.</para>
803fb7
   </refsect1>
803fb7
 
803fb7
-  <xi:include href="standard-conf.xml" xpointer="confd" />
803fb7
-  <xi:include href="standard-conf.xml" xpointer="conf" />
803fb7
+  <xi:include href="standard-conf.xml" xpointer="main-conf" />
803fb7
 
803fb7
   <refsect1>
803fb7
     <title>Options</title>
803fb7
diff --git a/man/coredump.conf.xml b/man/coredump.conf.xml
803fb7
index 3d325e6ad..0b7329bf5 100644
803fb7
--- a/man/coredump.conf.xml
803fb7
+++ b/man/coredump.conf.xml
803fb7
@@ -63,8 +63,7 @@
803fb7
     a handler for core dumps invoked by the kernel.</para>
803fb7
   </refsect1>
803fb7
 
803fb7
-  <xi:include href="standard-conf.xml" xpointer="confd" />
803fb7
-  <xi:include href="standard-conf.xml" xpointer="conf" />
803fb7
+  <xi:include href="standard-conf.xml" xpointer="main-conf" />
803fb7
 
803fb7
   <refsect1>
803fb7
     <title>Options</title>
803fb7
diff --git a/man/journald.conf.xml b/man/journald.conf.xml
803fb7
index 364b58f07..85146b0d8 100644
803fb7
--- a/man/journald.conf.xml
803fb7
+++ b/man/journald.conf.xml
803fb7
@@ -64,8 +64,7 @@
803fb7
 
803fb7
   </refsect1>
803fb7
 
803fb7
-  <xi:include href="standard-conf.xml" xpointer="confd" />
803fb7
-  <xi:include href="standard-conf.xml" xpointer="conf" />
803fb7
+  <xi:include href="standard-conf.xml" xpointer="main-conf" />
803fb7
 
803fb7
   <refsect1>
803fb7
     <title>Options</title>
803fb7
diff --git a/man/logind.conf.xml b/man/logind.conf.xml
803fb7
index ffaec5035..ca2b18783 100644
803fb7
--- a/man/logind.conf.xml
803fb7
+++ b/man/logind.conf.xml
803fb7
@@ -58,11 +58,13 @@
803fb7
   <refsect1>
803fb7
     <title>Description</title>
803fb7
 
803fb7
-    <para>These files configure various parameters of the systemd login manager, <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
803fb7
+    <para>These files configure various parameters of the systemd
803fb7
+    login manager,
803fb7
+    <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
803fb7
+    </para>
803fb7
   </refsect1>
803fb7
 
803fb7
-  <xi:include href="standard-conf.xml" xpointer="confd" />
803fb7
-  <xi:include href="standard-conf.xml" xpointer="conf" />
803fb7
+  <xi:include href="standard-conf.xml" xpointer="main-conf" />
803fb7
 
803fb7
   <refsect1>
803fb7
     <title>Options</title>
803fb7
diff --git a/man/resolved.conf.xml b/man/resolved.conf.xml
803fb7
index 36cae2706..8047a4ea7 100644
803fb7
--- a/man/resolved.conf.xml
803fb7
+++ b/man/resolved.conf.xml
803fb7
@@ -63,8 +63,7 @@
803fb7
 
803fb7
   </refsect1>
803fb7
 
803fb7
-  <xi:include href="standard-conf.xml" xpointer="confd" />
803fb7
-  <xi:include href="standard-conf.xml" xpointer="conf" />
803fb7
+  <xi:include href="standard-conf.xml" xpointer="main-conf" />
803fb7
 
803fb7
   <refsect1>
803fb7
     <title>Options</title>
803fb7
diff --git a/man/standard-conf.xml b/man/standard-conf.xml
803fb7
index b87d7e955..36af45927 100644
803fb7
--- a/man/standard-conf.xml
803fb7
+++ b/man/standard-conf.xml
803fb7
@@ -33,13 +33,39 @@
803fb7
     configuration file.</para>
803fb7
   </refsection>
803fb7
 
803fb7
-  <refsection id='conf'>
803fb7
-    <title>Configuration File</title>
803fb7
-
803fb7
-    <para>Configuration is also read from a single configuration file in
803fb7
-    <filename>/etc/</filename>. This file is read before any of the
803fb7
-    configuration directories, and has the lowest precedence; entries in a file
803fb7
-    in any configuration directory override entries in the single configuration
803fb7
-    file.</para>
803fb7
+  <refsection id='main-conf'>
803fb7
+    <title>Configuration Directories and Precedence</title>
803fb7
+
803fb7
+    <para>Default configuration is defined during compilation, so a
803fb7
+    configuration file is only needed when it is necessary to deviate
803fb7
+    from those defaults. By default the configuration file in
803fb7
+    <filename>/etc/systemd/</filename> contains commented out entries
803fb7
+    showing the defaults as a guide to the administrator. This file
803fb7
+    can be edited to create local overrides.
803fb7
+    </para>
803fb7
+
803fb7
+    <para>When packages need to customize the configuration, they can
803fb7
+    install configuration snippets in
803fb7
+    <filename>/usr/lib/systemd/*.conf.d/</filename>. Files in
803fb7
+    <filename>/etc/</filename> are reserved for the local
803fb7
+    administrator, who may use this logic to override the
803fb7
+    configuration files installed by vendor packages. The main
803fb7
+    configuration file is read before any of the configuration
803fb7
+    directories, and has the lowest precedence; entries in a file in
803fb7
+    any configuration directory override entries in the single
803fb7
+    configuration file. Files in the
803fb7
+    <filename>logind.conf.d/</filename> configuration subdirectories
803fb7
+    are sorted by their filename in lexicographic order, regardless of
803fb7
+    which of the subdirectories they reside in. If multiple files
803fb7
+    specify the same option, the entry in the file with the
803fb7
+    lexicographically latest name takes precedence.  It is recommended
803fb7
+    to prefix all filenames in those subdirectories with a two-digit
803fb7
+    number and a dash, to simplify the ordering of the files.</para>
803fb7
+
803fb7
+    <para>To disable a configuration file supplied by the vendor, the
803fb7
+    recommended way is to place a symlink to
803fb7
+    <filename>/dev/null</filename> in the configuration directory in
803fb7
+    <filename>/etc/</filename>, with the same filename as the vendor
803fb7
+    configuration file.</para>
803fb7
   </refsection>
803fb7
 </refsection>
803fb7
diff --git a/man/systemd-sleep.conf.xml b/man/systemd-sleep.conf.xml
803fb7
index 433f2f83a..bb17ec866 100644
803fb7
--- a/man/systemd-sleep.conf.xml
803fb7
+++ b/man/systemd-sleep.conf.xml
803fb7
@@ -112,8 +112,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
803fb7
     attempts to suspend or hibernate the machine.</para>
803fb7
   </refsect1>
803fb7
 
803fb7
-  <xi:include href="standard-conf.xml" xpointer="confd" />
803fb7
-  <xi:include href="standard-conf.xml" xpointer="conf" />
803fb7
+  <xi:include href="standard-conf.xml" xpointer="main-conf" />
803fb7
 
803fb7
   <refsect1>
803fb7
     <title>Options</title>
803fb7
diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml
803fb7
index 7c3f23756..c7bcfaee4 100644
803fb7
--- a/man/systemd-system.conf.xml
803fb7
+++ b/man/systemd-system.conf.xml
803fb7
@@ -74,8 +74,7 @@
803fb7
     operations.</para>
803fb7
   </refsect1>
803fb7
 
803fb7
-  <xi:include href="standard-conf.xml" xpointer="confd" />
803fb7
-  <xi:include href="standard-conf.xml" xpointer="conf" />
803fb7
+  <xi:include href="standard-conf.xml" xpointer="main-conf" />
803fb7
 
803fb7
   <refsect1>
803fb7
     <title>Options</title>
803fb7
diff --git a/man/timesyncd.conf.xml b/man/timesyncd.conf.xml
803fb7
index 1127970a1..89a651c66 100644
803fb7
--- a/man/timesyncd.conf.xml
803fb7
+++ b/man/timesyncd.conf.xml
803fb7
@@ -63,8 +63,7 @@
803fb7
 
803fb7
   </refsect1>
803fb7
 
803fb7
-  <xi:include href="standard-conf.xml" xpointer="confd" />
803fb7
-  <xi:include href="standard-conf.xml" xpointer="conf" />
803fb7
+  <xi:include href="standard-conf.xml" xpointer="main-conf" />
803fb7
 
803fb7
   <refsect1>
803fb7
     <title>Options</title>
803fb7
diff --git a/src/bootchart/bootchart.conf b/src/bootchart/bootchart.conf
803fb7
index 2d7cb6121..4f5e50936 100644
803fb7
--- a/src/bootchart/bootchart.conf
803fb7
+++ b/src/bootchart/bootchart.conf
803fb7
@@ -5,10 +5,11 @@
803fb7
 #  the Free Software Foundation; either version 2.1 of the License, or
803fb7
 #  (at your option) any later version.
803fb7
 #
803fb7
-# You can override the directives in this file by creating files in
803fb7
-# /etc/systemd/bootchart.conf.d/*.conf.
803fb7
+# Entries in this file show the compile time defaults.
803fb7
+# You can change settings by editing this file.
803fb7
+# Defaults can be restored by simply deleting this file.
803fb7
 #
803fb7
-# See bootchart.conf(5) for details
803fb7
+# See bootchart.conf(5) for details.
803fb7
 
803fb7
 [Bootchart]
803fb7
 #Samples=500
803fb7
diff --git a/src/core/system.conf b/src/core/system.conf
803fb7
index a3727200d..231609033 100644
803fb7
--- a/src/core/system.conf
803fb7
+++ b/src/core/system.conf
803fb7
@@ -5,10 +5,11 @@
803fb7
 #  the Free Software Foundation; either version 2.1 of the License, or
803fb7
 #  (at your option) any later version.
803fb7
 #
803fb7
-# You can override the directives in this file by creating files in
803fb7
-# /etc/systemd/system.conf.d/*.conf.
803fb7
+# Entries in this file show the compile time defaults.
803fb7
+# You can change settings by editing this file.
803fb7
+# Defaults can be restored by simply deleting this file.
803fb7
 #
803fb7
-# See systemd-system.conf(5) for details
803fb7
+# See systemd-system.conf(5) for details.
803fb7
 
803fb7
 [Manager]
803fb7
 #LogLevel=info
803fb7
diff --git a/src/journal/coredump.conf b/src/journal/coredump.conf
803fb7
index 0fe9fe801..c2f0643e0 100644
803fb7
--- a/src/journal/coredump.conf
803fb7
+++ b/src/journal/coredump.conf
803fb7
@@ -5,10 +5,11 @@
803fb7
 #  the Free Software Foundation; either version 2.1 of the License, or
803fb7
 #  (at your option) any later version.
803fb7
 #
803fb7
-# You can override the directives in this file by creating files in
803fb7
-# /etc/systemd/coredump.conf.d/*.conf.
803fb7
+# Entries in this file show the compile time defaults.
803fb7
+# You can change settings by editing this file.
803fb7
+# Defaults can be restored by simply deleting this file.
803fb7
 #
803fb7
-# See coredump.conf(5) for details
803fb7
+# See coredump.conf(5) for details.
803fb7
 
803fb7
 [Coredump]
803fb7
 #Storage=external
803fb7
diff --git a/src/journal/journald.conf b/src/journal/journald.conf
803fb7
index 29bdf8f18..47eefe91c 100644
803fb7
--- a/src/journal/journald.conf
803fb7
+++ b/src/journal/journald.conf
803fb7
@@ -5,10 +5,11 @@
803fb7
 #  the Free Software Foundation; either version 2.1 of the License, or
803fb7
 #  (at your option) any later version.
803fb7
 #
803fb7
-# You can override the directives in this file by creating files in
803fb7
-# /etc/systemd/journald.conf.d/*.conf.
803fb7
+# Entries in this file show the compile time defaults.
803fb7
+# You can change settings by editing this file.
803fb7
+# Defaults can be restored by simply deleting this file.
803fb7
 #
803fb7
-# See journald.conf(5) for details
803fb7
+# See journald.conf(5) for details.
803fb7
 
803fb7
 [Journal]
803fb7
 #Storage=auto
803fb7
diff --git a/src/login/logind.conf b/src/login/logind.conf
803fb7
index 6b1943a2d..834c4c2eb 100644
803fb7
--- a/src/login/logind.conf
803fb7
+++ b/src/login/logind.conf
803fb7
@@ -5,10 +5,11 @@
803fb7
 #  the Free Software Foundation; either version 2.1 of the License, or
803fb7
 #  (at your option) any later version.
803fb7
 #
803fb7
-# You can override the directives in this file by creating files in
803fb7
-# /etc/systemd/logind.conf.d/*.conf.
803fb7
+# Entries in this file show the compile time defaults.
803fb7
+# You can change settings by editing this file.
803fb7
+# Defaults can be restored by simply deleting this file.
803fb7
 #
803fb7
-# See logind.conf(5) for details
803fb7
+# See logind.conf(5) for details.
803fb7
 
803fb7
 [Login]
803fb7
 #NAutoVTs=6
803fb7
diff --git a/src/resolve/resolved.conf.in b/src/resolve/resolved.conf.in
803fb7
index e5a19ee47..3eb19e42b 100644
803fb7
--- a/src/resolve/resolved.conf.in
803fb7
+++ b/src/resolve/resolved.conf.in
803fb7
@@ -5,8 +5,9 @@
803fb7
 #  the Free Software Foundation; either version 2.1 of the License, or
803fb7
 #  (at your option) any later version.
803fb7
 #
803fb7
-# You can override the directives in this file by creating files in
803fb7
-# /etc/systemd/resolved.conf.d/*.conf.
803fb7
+# Entries in this file show the compile time defaults.
803fb7
+# You can change settings by editing this file.
803fb7
+# Defaults can be restored by simply deleting this file.
803fb7
 #
803fb7
 # See resolved.conf(5) for details
803fb7
 
803fb7
diff --git a/src/timesync/timesyncd.conf.in b/src/timesync/timesyncd.conf.in
803fb7
index fc3c6c49c..b6a2ada27 100644
803fb7
--- a/src/timesync/timesyncd.conf.in
803fb7
+++ b/src/timesync/timesyncd.conf.in
803fb7
@@ -5,10 +5,11 @@
803fb7
 #  the Free Software Foundation; either version 2.1 of the License, or
803fb7
 #  (at your option) any later version.
803fb7
 #
803fb7
-# You can override the directives in this file by creating files in
803fb7
-# /etc/systemd/timesyncd.conf.d/*.conf.
803fb7
+# Entries in this file show the compile time defaults.
803fb7
+# You can change settings by editing this file.
803fb7
+# Defaults can be restored by simply deleting this file.
803fb7
 #
803fb7
-# See timesyncd.conf(5) for details
803fb7
+# See timesyncd.conf(5) for details.
803fb7
 
803fb7
 [Time]
803fb7
 #NTP=