valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

Blame SOURCES/0067-Do-not-advertise-.d-snippets-over-main-config-file.patch

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