chiark / gitweb /
core: Support system.conf.d and user.conf.d directories in the usual search paths
authorJosh Triplett <josh@joshtriplett.org>
Sat, 29 Nov 2014 09:06:04 +0000 (01:06 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 29 Nov 2014 18:55:31 +0000 (13:55 -0500)
Makefile-man.am
man/systemd-system.conf.xml
man/systemd.xml
src/core/main.c
src/core/system.conf
src/core/user.conf

index c24606a9cef7c09083fc6f535ff42f1f9d4306d0..f025be0b35d10f004c0b5229b878616f1af2ed22 100644 (file)
@@ -195,6 +195,7 @@ MANPAGES_ALIAS += \
        man/sd_journal_wait.3 \
        man/sd_machine_get_ifindices.3 \
        man/sd_notifyf.3 \
+       man/system.conf.d.5 \
        man/systemd-ask-password-console.path.8 \
        man/systemd-ask-password-wall.path.8 \
        man/systemd-ask-password-wall.service.8 \
@@ -227,7 +228,8 @@ MANPAGES_ALIAS += \
        man/systemd-udevd-kernel.socket.8 \
        man/systemd-udevd.8 \
        man/systemd-update-done.8 \
-       man/systemd-user.conf.5
+       man/systemd-user.conf.5 \
+       man/user.conf.d.5
 man/SD_ALERT.3: man/sd-daemon.3
 man/SD_CRIT.3: man/sd-daemon.3
 man/SD_DEBUG.3: man/sd-daemon.3
@@ -301,6 +303,7 @@ man/sd_journal_test_cursor.3: man/sd_journal_get_cursor.3
 man/sd_journal_wait.3: man/sd_journal_get_fd.3
 man/sd_machine_get_ifindices.3: man/sd_machine_get_class.3
 man/sd_notifyf.3: man/sd_notify.3
+man/system.conf.d.5: man/systemd-system.conf.5
 man/systemd-ask-password-console.path.8: man/systemd-ask-password-console.service.8
 man/systemd-ask-password-wall.path.8: man/systemd-ask-password-console.service.8
 man/systemd-ask-password-wall.service.8: man/systemd-ask-password-console.service.8
@@ -334,6 +337,7 @@ man/systemd-udevd-kernel.socket.8: man/systemd-udevd.service.8
 man/systemd-udevd.8: man/systemd-udevd.service.8
 man/systemd-update-done.8: man/systemd-update-done.service.8
 man/systemd-user.conf.5: man/systemd-system.conf.5
+man/user.conf.d.5: man/systemd-system.conf.5
 man/SD_ALERT.html: man/sd-daemon.html
        $(html-alias)
 
@@ -553,6 +557,9 @@ man/sd_machine_get_ifindices.html: man/sd_machine_get_class.html
 man/sd_notifyf.html: man/sd_notify.html
        $(html-alias)
 
+man/system.conf.d.html: man/systemd-system.conf.html
+       $(html-alias)
+
 man/systemd-ask-password-console.path.html: man/systemd-ask-password-console.service.html
        $(html-alias)
 
@@ -652,6 +659,9 @@ man/systemd-update-done.html: man/systemd-update-done.service.html
 man/systemd-user.conf.html: man/systemd-system.conf.html
        $(html-alias)
 
+man/user.conf.d.html: man/systemd-system.conf.html
+       $(html-alias)
+
 
 if ENABLE_BACKLIGHT
 MANPAGES += \
index 284516d93102c46dc98170e81b8fed6bd9ea0ed4..dfb180cc54c0dfb9649ca5ee38cdc605bcf6b468 100644 (file)
@@ -22,7 +22,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
 
-<refentry id="systemd-system.conf">
+<refentry id="systemd-system.conf"
+          xmlns:xi="http://www.w3.org/2001/XInclude">
         <refentryinfo>
                 <title>systemd-system.conf</title>
                 <productname>systemd</productname>
 
         <refnamediv>
                 <refname>systemd-system.conf</refname>
+                <refname>system.conf.d</refname>
                 <refname>systemd-user.conf</refname>
-                <refpurpose>System and session service manager configuration file</refpurpose>
+                <refname>user.conf.d</refname>
+                <refpurpose>System and session service manager configuration files</refpurpose>
         </refnamediv>
 
         <refsynopsisdiv>
                 <para><filename>/etc/systemd/system.conf</filename></para>
+                <para><filename>/etc/systemd/system.conf.d/*.conf</filename></para>
+                <para><filename>/run/systemd/system.conf.d/*.conf</filename></para>
+                <para><filename>/usr/lib/systemd/system.conf.d/*.conf</filename></para>
                 <para><filename>/etc/systemd/user.conf</filename></para>
+                <para><filename>/etc/systemd/user.conf.d/*.conf</filename></para>
+                <para><filename>/run/systemd/user.conf.d/*.conf</filename></para>
+                <para><filename>/usr/lib/systemd/user.conf.d/*.conf</filename></para>
         </refsynopsisdiv>
 
         <refsect1>
                 <title>Description</title>
 
-                <para>When run as system instance systemd reads the
-                configuration file <filename>system.conf</filename>,
-                otherwise <filename>user.conf</filename>. These
+                <para>When run as a system instance, systemd interprets the
+                configuration file <filename>system.conf</filename> and the
+                files in <filename>system.conf.d</filename> directories; when
+                run as a user instance, systemd interprets the configuration
+                file <filename>user.conf</filename> and the files in
+                <filename>user.conf.d</filename> directories. These
                 configuration files contain a few settings controlling
                 basic manager operations.</para>
         </refsect1>
 
+        <xi:include href="standard-conf.xml" xpointer="confd" />
+        <xi:include href="standard-conf.xml" xpointer="conf" />
+
         <refsect1>
                 <title>Options</title>
 
index bf7a7a6f67209c7dc4384d1e3c9af46ef1b191b4..d776815414747d88ee1f40c04f87c8d845538e03 100644 (file)
                 <citerefentry><refentrytitle>telinit</refentrytitle><manvolnum>8</manvolnum></citerefentry>
                 for more information.</para>
 
-                <para>When run as system instance, systemd interprets
-                the configuration file
-                <filename>system.conf</filename>, otherwise
-                <filename>user.conf</filename>. See
+                <para>When run as a system instance, systemd interprets the
+                configuration file <filename>system.conf</filename> and the
+                files in <filename>system.conf.d</filename> directories; when
+                run as a user instance, systemd interprets the configuration
+                file <filename>user.conf</filename> and the files in
+                <filename>user.conf.d</filename> directories. See
                 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
                 for more information.</para>
         </refsect1>
index c9fd56232c7648160b531d4bd3158fd4cc132af2..140f2195acae4960343714cec053bdfed0f85096 100644 (file)
@@ -667,13 +667,12 @@ static int parse_config_file(void) {
                 {}
         };
 
-        const char *fn;
+        const char *fn, *conf_dirs_nulstr;
 
         fn = arg_running_as == SYSTEMD_SYSTEM ? PKGSYSCONFDIR "/system.conf" : PKGSYSCONFDIR "/user.conf";
-        config_parse(NULL, fn, NULL,
-                     "Manager\0",
-                     config_item_table_lookup, items,
-                     false, false, true, NULL);
+        conf_dirs_nulstr = arg_running_as == SYSTEMD_SYSTEM ? CONF_DIRS_NULSTR("systemd/system.conf") : CONF_DIRS_NULSTR("systemd/user.conf");
+        config_parse_many(fn, conf_dirs_nulstr, "Manager\0",
+                          config_item_table_lookup, items, false, NULL);
 
         return 0;
 }
index 65a35a06896db476af1dcf25d04092271b74709e..a3727200dfaf33ac93181db62cb23c8fbb3d4944 100644 (file)
@@ -5,6 +5,9 @@
 #  the Free Software Foundation; either version 2.1 of the License, or
 #  (at your option) any later version.
 #
+# You can override the directives in this file by creating files in
+# /etc/systemd/system.conf.d/*.conf.
+#
 # See systemd-system.conf(5) for details
 
 [Manager]
index 8c7ecde727a622cca2a026702355978181c86d2a..87c8164378c7d587bba53ece84b900c2a69128cf 100644 (file)
@@ -5,6 +5,9 @@
 #  the Free Software Foundation; either version 2.1 of the License, or
 #  (at your option) any later version.
 #
+# You can override the directives in this file by creating files in
+# /etc/systemd/user.conf.d/*.conf.
+#
 # See systemd-user.conf(5) for details
 
 [Manager]