Luca Berra: allow redefinition of VAR_RUN

Martin F. Krafft madduck at alioth.debian.org
Mon May 24 09:21:10 UTC 2010


Module: mdadm
Branch: upstream
Commit: c132678b18c1aeb3f3eaa2ece4aafebd5e2b47a6
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=c132678b18c1aeb3f3eaa2ece4aafebd5e2b47a6

Author: Luca Berra <bluca at comedia.it>
Date:   Sun Feb 28 15:46:16 2010 +0100

allow redefinition of VAR_RUN

having mdmon socket under var is painful at shutdown time

Signed-off-by: Luca Berra <bluca at comedia.it>
Signed-off-by: NeilBrown <neilb at suse.de>

---

 Makefile |    4 +++-
 mdadm.h  |   11 +++++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index a23923c..cfe6b92 100644
--- a/Makefile
+++ b/Makefile
@@ -63,8 +63,10 @@ CONFFILEFLAGS = -DCONFFILE=\"$(CONFFILE)\" -DCONFFILE2=\"$(CONFFILE2)\"
 # If you don't have /lib/init/rw you might want to use /dev/.something
 #  e.g. make ALT_RUN=/dev/.mdadm
 ALT_RUN = /lib/init/rw
+VAR_RUN = /var/run
 ALTFLAGS = -DALT_RUN=\"$(ALT_RUN)\"
-CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(ALTFLAGS)
+VARFLAGS = -DVAR_RUN=\"$(VAR_RUN)\"
+CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(ALTFLAGS) $(VARFLAGS)
 
 # If you want a static binary, you might uncomment these
 # LDFLAGS = -static
diff --git a/mdadm.h b/mdadm.h
index df3a056..3628ea0 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -68,7 +68,18 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
 #define DEFAULT_BITMAP_DELAY 5
 #define DEFAULT_MAX_WRITE_BEHIND 256
 
+/* VAR_RUN is where pid and socket files used for communicating
+ * with mdmon normally live.  It should be /var/run, but if
+ * it is too hard to remount /var/run as read-only rather than
+ * unmounting it at shutdown time, then it should be
+ * redefined to some place that comfortably persists until
+ * final shutdown, possibly in /dev if that is a tmpfs.
+ * Note: VAR_RUN does not need to be writable at shutdown,
+ * only during boot when "mdmon --takeover" is run.
+ */
+#ifndef VAR_RUN
 #define VAR_RUN "/var/run/mdadm"
+#endif /* VAR_RUN */
 /* ALT_RUN should be somewhere that persists across the pivotroot
  * from early boot to late boot.
  * If you don't have /lib/init/rw you might want to use /dev/.something




More information about the pkg-mdadm-commits mailing list