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