]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Allow /etc/mdadm/mdadm.conf as an alternate to /etc/mdadm.conf
authorNeil Brown <neilb@suse.de>
Fri, 9 Dec 2005 05:01:22 +0000 (05:01 +0000)
committerNeil Brown <neilb@suse.de>
Fri, 9 Dec 2005 05:01:22 +0000 (05:01 +0000)
This provide compatability with Debian.

Signed-off-by: Neil Brown <neilb@suse.de>
ChangeLog
config.c

index 010d06ca2b0b9b6355068da24d23b001b7c5e611..e0f6cb58e7857f3801356d685bb8c04ae17f7936 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Changes Prior to this release
+    -   Try /etc/mdadm/mdadm.conf if /etc/mdadm.conf doesn't exist.
+       This provided compatability for Debian.
+
 Changes Prior to 2.2 release
     -   Assorted bug fixes
     -   Support write-intent-bitmaps on raid10
index b44451540da7b87670f797fd3353c4ddb393d880..c09c2061b5a75e40e73fa00818aa908c7c58956d 100644 (file)
--- a/config.c
+++ b/config.c
 #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;