]> err.no Git - systemd/commitdiff
conf: when looking for configurations look in /etc first, in /run second
authorLennart Poettering <lennart@poettering.net>
Wed, 14 Mar 2012 13:25:05 +0000 (14:25 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 14 Mar 2012 13:25:05 +0000 (14:25 +0100)
After long consideration we came to the conclusion that user
configuration in /etc should always override the (generally computer
generated) configuration in /run. User configuration should always be
what matters over anything else. Hence rearrange the search orders
accordingly.

In general this should change very little as overriding like this is
seldomn done so far, and the order between /etc and /usr stays the same.

man/binfmt.d.xml
man/modules-load.d.xml
man/sysctl.d.xml
man/tmpfiles.d.xml
src/binfmt/binfmt.c
src/modules-load.c
src/path-lookup.c
src/sysctl.c
src/systemd.pc.in
src/tmpfiles.c

index 966778ded27479ae177ae02ea4ab03e4c4c73281..f5ec805e29c41986c40456bf3e2dde2383f547da 100644 (file)
@@ -46,9 +46,9 @@
         </refnamediv>
 
         <refsynopsisdiv>
-                <para><filename>/usr/lib/binfmt.d/*.conf</filename></para>
                 <para><filename>/etc/binfmt.d/*.conf</filename></para>
                 <para><filename>/run/binfmt.d/*.conf</filename></para>
+                <para><filename>/usr/lib/binfmt.d/*.conf</filename></para>
         </refsynopsisdiv>
 
         <refsect1>
index b63366347540725e53c6182f2471896fddfbf6c8..e2f7d5c68cbda91d06c159fbb6a225c04a94ae06 100644 (file)
@@ -46,9 +46,9 @@
         </refnamediv>
 
         <refsynopsisdiv>
-                <para><filename>/usr/lib/modules-load.d/*.conf</filename></para>
                 <para><filename>/etc/modules-load.d/*.conf</filename></para>
                 <para><filename>/run/modules-load.d/*.conf</filename></para>
+                <para><filename>/usr/lib/modules-load.d/*.conf</filename></para>
         </refsynopsisdiv>
 
         <refsect1>
index 240aa8113798e5a8cec96b2490abb5384fe23ff7..9c108b0b7c3030af1a0efe82cf455db868a77a5f 100644 (file)
@@ -46,9 +46,9 @@
         </refnamediv>
 
         <refsynopsisdiv>
-                <para><filename>/usr/lib/sysctl.d/*.conf</filename></para>
                 <para><filename>/etc/sysctl.d/*.conf</filename></para>
                 <para><filename>/run/sysctl.d/*.conf</filename></para>
+                <para><filename>/usr/lib/sysctl.d/*.conf</filename></para>
         </refsynopsisdiv>
 
         <refsect1>
index b6bf3630e94c627bfbccaaa872a3d563fe151e44..f70bf0ef9f712257d367fd2793127fd60f156804 100644 (file)
@@ -47,9 +47,9 @@
         </refnamediv>
 
         <refsynopsisdiv>
-                <para><filename>/usr/lib/tmpfiles.d/*.conf</filename></para>
                 <para><filename>/etc/tmpfiles.d/*.conf</filename></para>
                 <para><filename>/run/tmpfiles.d/*.conf</filename></para>
+                <para><filename>/usr/lib/tmpfiles.d/*.conf</filename></para>
         </refsynopsisdiv>
 
         <refsect1>
index e8d65243918453276cc2165076583f9d4b387d12..0e60618e9080b5ff40613e168258130bead6604f 100644 (file)
@@ -138,8 +138,8 @@ int main(int argc, char *argv[]) {
                 write_one_line_file("/proc/sys/fs/binfmt_misc/status", "-1");
 
                 r = conf_files_list(&files, ".conf",
-                                    "/run/binfmt.d",
                                     "/etc/binfmt.d",
+                                    "/run/binfmt.d",
                                     "/usr/local/lib/binfmt.d",
                                     "/usr/lib/binfmt.d",
                                     NULL);
index 043e909d8096aacb6acda1fa73ce279ea836307e..77fe3eaf2645c77bb82983d89cd2a22a3964500b 100644 (file)
@@ -68,8 +68,8 @@ int main(int argc, char *argv[]) {
         kmod_set_log_fn(ctx, systemd_kmod_log, NULL);
 
         if (conf_files_list(&files, ".conf",
-                            "/run/modules-load.d",
                             "/etc/modules-load.d",
+                            "/run/modules-load.d",
                             "/usr/local/lib/modules-load.d",
                             "/usr/lib/modules-load.d",
                             "/lib/modules-load.d",
index 93fdf6369915562db56264aae038a8452304459d..e6f050d4ff65820d18e38e2ced46114ddc0244a2 100644 (file)
@@ -54,9 +54,9 @@ int user_config_home(char **config_home) {
 
 static char** user_dirs(void) {
         const char * const config_unit_paths[] = {
-                "/run/systemd/user",
                 USER_CONFIG_UNIT_PATH,
                 "/etc/systemd/user",
+                "/run/systemd/user",
                 NULL
         };
 
@@ -207,9 +207,9 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as, bool personal
                                                 /* If you modify this you also want to modify
                                                  * systemduserunitpath= in systemd.pc.in, and
                                                  * the arrays in user_dirs() above! */
-                                                "/run/systemd/user",
                                                 USER_CONFIG_UNIT_PATH,
                                                 "/etc/systemd/user",
+                                                "/run/systemd/user",
                                                 "/usr/local/lib/systemd/user",
                                                 "/usr/local/share/systemd/user",
                                                 USER_DATA_UNIT_PATH,
@@ -224,9 +224,9 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as, bool personal
                         if (!(p->unit_path = strv_new(
                                               /* If you modify this you also want to modify
                                                * systemdsystemunitpath= in systemd.pc.in! */
-                                              "/run/systemd/system",
                                               SYSTEM_CONFIG_UNIT_PATH,
                                               "/etc/systemd/system",
+                                              "/run/systemd/system",
                                               "/usr/local/lib/systemd/system",
                                               "/usr/lib/systemd/system",
                                               SYSTEM_DATA_UNIT_PATH,
index 8bdfb0811ce880b01601c7120f549a62cb785394..852ec91c9c9049bbe2260265437c7bb9b5104502 100644 (file)
@@ -236,8 +236,8 @@ int main(int argc, char *argv[]) {
                 char **files, **f;
 
                 r = conf_files_list(&files, ".conf",
-                                    "/run/sysctl.d",
                                     "/etc/sysctl.d",
+                                    "/run/sysctl.d",
                                     "/usr/local/lib/sysctl.d",
                                     "/usr/lib/sysctl.d",
                                     "/lib/sysctl.d",
index 4f2abb0868926087b8068e6546b8b13cbbc70694..61de30561b9e5a2d09f4af626895aa394862c346 100644 (file)
@@ -12,8 +12,8 @@ systemdsystemunitdir=@systemunitdir@
 systemduserunitdir=@userunitdir@
 systemdsystemconfdir=@pkgsysconfdir@/system
 systemduserconfdir=@pkgsysconfdir@/user
-systemdsystemunitpath=/run/systemd/system:${systemdsystemconfdir}:/etc/systemd/system:/usr/local/share/systemd/system:/usr/local/lib/systemd/system:/usr/share/systemd/system:/usr/lib/systemd/system:/lib/systemd/system:${systemdsystemunitdir}
-systemduserunitpath=${systemduserconfdir}:/etc/systemd/user:/usr/local/share/systemd/user:/usr/local/lib/systemd/user:/usr/share/systemd/user:/usr/lib/systemd/user:${systemduserunitdir}
+systemdsystemunitpath=${systemdsystemconfdir}:/etc/systemd/system:/run/systemd/system:/usr/local/share/systemd/system:/usr/local/lib/systemd/system:/usr/share/systemd/system:/usr/lib/systemd/system:/lib/systemd/system:${systemdsystemunitdir}
+systemduserunitpath=${systemduserconfdir}:/etc/systemd/user:/run/systemd/user:/usr/local/share/systemd/user:/usr/local/lib/systemd/user:/usr/share/systemd/user:/usr/lib/systemd/user:${systemduserunitdir}
 
 Name: systemd
 Description: systemd System and Service Manager
index 8cbce12dcd14e014b80995d6d6605ae309b4c100..873bf233fd36e84d85c0d9fab163c2f0330c4519 100644 (file)
@@ -1271,8 +1271,8 @@ int main(int argc, char *argv[]) {
                 char **files, **f;
 
                 r = conf_files_list(&files, ".conf",
-                                    "/run/tmpfiles.d",
                                     "/etc/tmpfiles.d",
+                                    "/run/tmpfiles.d",
                                     "/usr/local/lib/tmpfiles.d",
                                     "/usr/lib/tmpfiles.d",
                                     NULL);