conf: when looking for configurations look in /etc first, in /run second

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.
This commit is contained in:
Lennart Poettering 2012-03-14 14:25:05 +01:00
parent 45dc3a0478
commit fc1a2e06a2
10 changed files with 13 additions and 13 deletions

View File

@ -46,9 +46,9 @@
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<para><filename>/usr/lib/binfmt.d/*.conf</filename></para>
<para><filename>/etc/binfmt.d/*.conf</filename></para> <para><filename>/etc/binfmt.d/*.conf</filename></para>
<para><filename>/run/binfmt.d/*.conf</filename></para> <para><filename>/run/binfmt.d/*.conf</filename></para>
<para><filename>/usr/lib/binfmt.d/*.conf</filename></para>
</refsynopsisdiv> </refsynopsisdiv>
<refsect1> <refsect1>

View File

@ -46,9 +46,9 @@
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<para><filename>/usr/lib/modules-load.d/*.conf</filename></para>
<para><filename>/etc/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>/run/modules-load.d/*.conf</filename></para>
<para><filename>/usr/lib/modules-load.d/*.conf</filename></para>
</refsynopsisdiv> </refsynopsisdiv>
<refsect1> <refsect1>

View File

@ -46,9 +46,9 @@
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<para><filename>/usr/lib/sysctl.d/*.conf</filename></para>
<para><filename>/etc/sysctl.d/*.conf</filename></para> <para><filename>/etc/sysctl.d/*.conf</filename></para>
<para><filename>/run/sysctl.d/*.conf</filename></para> <para><filename>/run/sysctl.d/*.conf</filename></para>
<para><filename>/usr/lib/sysctl.d/*.conf</filename></para>
</refsynopsisdiv> </refsynopsisdiv>
<refsect1> <refsect1>

View File

@ -47,9 +47,9 @@
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<para><filename>/usr/lib/tmpfiles.d/*.conf</filename></para>
<para><filename>/etc/tmpfiles.d/*.conf</filename></para> <para><filename>/etc/tmpfiles.d/*.conf</filename></para>
<para><filename>/run/tmpfiles.d/*.conf</filename></para> <para><filename>/run/tmpfiles.d/*.conf</filename></para>
<para><filename>/usr/lib/tmpfiles.d/*.conf</filename></para>
</refsynopsisdiv> </refsynopsisdiv>
<refsect1> <refsect1>

View File

@ -138,8 +138,8 @@ int main(int argc, char *argv[]) {
write_one_line_file("/proc/sys/fs/binfmt_misc/status", "-1"); write_one_line_file("/proc/sys/fs/binfmt_misc/status", "-1");
r = conf_files_list(&files, ".conf", r = conf_files_list(&files, ".conf",
"/run/binfmt.d",
"/etc/binfmt.d", "/etc/binfmt.d",
"/run/binfmt.d",
"/usr/local/lib/binfmt.d", "/usr/local/lib/binfmt.d",
"/usr/lib/binfmt.d", "/usr/lib/binfmt.d",
NULL); NULL);

View File

@ -68,8 +68,8 @@ int main(int argc, char *argv[]) {
kmod_set_log_fn(ctx, systemd_kmod_log, NULL); kmod_set_log_fn(ctx, systemd_kmod_log, NULL);
if (conf_files_list(&files, ".conf", if (conf_files_list(&files, ".conf",
"/run/modules-load.d",
"/etc/modules-load.d", "/etc/modules-load.d",
"/run/modules-load.d",
"/usr/local/lib/modules-load.d", "/usr/local/lib/modules-load.d",
"/usr/lib/modules-load.d", "/usr/lib/modules-load.d",
"/lib/modules-load.d", "/lib/modules-load.d",

View File

@ -54,9 +54,9 @@ int user_config_home(char **config_home) {
static char** user_dirs(void) { static char** user_dirs(void) {
const char * const config_unit_paths[] = { const char * const config_unit_paths[] = {
"/run/systemd/user",
USER_CONFIG_UNIT_PATH, USER_CONFIG_UNIT_PATH,
"/etc/systemd/user", "/etc/systemd/user",
"/run/systemd/user",
NULL 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 /* If you modify this you also want to modify
* systemduserunitpath= in systemd.pc.in, and * systemduserunitpath= in systemd.pc.in, and
* the arrays in user_dirs() above! */ * the arrays in user_dirs() above! */
"/run/systemd/user",
USER_CONFIG_UNIT_PATH, USER_CONFIG_UNIT_PATH,
"/etc/systemd/user", "/etc/systemd/user",
"/run/systemd/user",
"/usr/local/lib/systemd/user", "/usr/local/lib/systemd/user",
"/usr/local/share/systemd/user", "/usr/local/share/systemd/user",
USER_DATA_UNIT_PATH, 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 (!(p->unit_path = strv_new(
/* If you modify this you also want to modify /* If you modify this you also want to modify
* systemdsystemunitpath= in systemd.pc.in! */ * systemdsystemunitpath= in systemd.pc.in! */
"/run/systemd/system",
SYSTEM_CONFIG_UNIT_PATH, SYSTEM_CONFIG_UNIT_PATH,
"/etc/systemd/system", "/etc/systemd/system",
"/run/systemd/system",
"/usr/local/lib/systemd/system", "/usr/local/lib/systemd/system",
"/usr/lib/systemd/system", "/usr/lib/systemd/system",
SYSTEM_DATA_UNIT_PATH, SYSTEM_DATA_UNIT_PATH,

View File

@ -236,8 +236,8 @@ int main(int argc, char *argv[]) {
char **files, **f; char **files, **f;
r = conf_files_list(&files, ".conf", r = conf_files_list(&files, ".conf",
"/run/sysctl.d",
"/etc/sysctl.d", "/etc/sysctl.d",
"/run/sysctl.d",
"/usr/local/lib/sysctl.d", "/usr/local/lib/sysctl.d",
"/usr/lib/sysctl.d", "/usr/lib/sysctl.d",
"/lib/sysctl.d", "/lib/sysctl.d",

View File

@ -12,8 +12,8 @@ systemdsystemunitdir=@systemunitdir@
systemduserunitdir=@userunitdir@ systemduserunitdir=@userunitdir@
systemdsystemconfdir=@pkgsysconfdir@/system systemdsystemconfdir=@pkgsysconfdir@/system
systemduserconfdir=@pkgsysconfdir@/user 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} 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:/usr/local/share/systemd/user:/usr/local/lib/systemd/user:/usr/share/systemd/user:/usr/lib/systemd/user:${systemduserunitdir} 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 Name: systemd
Description: systemd System and Service Manager Description: systemd System and Service Manager

View File

@ -1271,8 +1271,8 @@ int main(int argc, char *argv[]) {
char **files, **f; char **files, **f;
r = conf_files_list(&files, ".conf", r = conf_files_list(&files, ".conf",
"/run/tmpfiles.d",
"/etc/tmpfiles.d", "/etc/tmpfiles.d",
"/run/tmpfiles.d",
"/usr/local/lib/tmpfiles.d", "/usr/local/lib/tmpfiles.d",
"/usr/lib/tmpfiles.d", "/usr/lib/tmpfiles.d",
NULL); NULL);