diff options
author | Neil Brown <neilb@suse.de> | 2005-12-09 06:01:22 +0100 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2005-12-09 06:01:22 +0100 |
commit | ce4fafd6377459d6b0a479b63e27ec85420e70ed (patch) | |
tree | 0d682e45787fd99fef58d5cb0569dc2e7bcdd2ae /config.c | |
parent | Release 2.2 (diff) | |
download | mdadm-ce4fafd6377459d6b0a479b63e27ec85420e70ed.tar.xz mdadm-ce4fafd6377459d6b0a479b63e27ec85420e70ed.zip |
Allow /etc/mdadm/mdadm.conf as an alternate to /etc/mdadm.conf
This provide compatability with Debian.
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -70,7 +70,12 @@ #ifndef CONFFILE #define CONFFILE "/etc/mdadm.conf" #endif +#ifndef CONFFILE2 +/* for Debian compatibility .... */ +#define CONFFILE2 "/etc/mdadm/mdadm.conf" +#endif char DefaultConfFile[] = CONFFILE; +char DefaultAltConfFile[] = CONFFILE2; char *keywords[] = { "device", "array", "mailaddr", "program", NULL }; @@ -455,7 +460,18 @@ void load_conffile(char *conffile) return; } f = fopen(conffile, "r"); - if (f ==NULL) + /* Debian chose to relocate mdadm.conf into /etc/mdadm/. + * To allow Debian users to compile from clean source and still + * have a working mdadm, we read /etc/mdadm/mdadm.conf + * if /etc/mdadm.conf doesn't exist + */ + if (f == NULL && + conffile == DefaultConfFile) { + f = fopen(DefaultAltConfFile, "r"); + if (f) + conffile = DefaultAltConfFile; + } + if (f == NULL) return; loaded = 1; |