[Ultrapossum-cvs 734] ultrapossum/module/failover ...

Zurück zum Archiv-Index

Masato Taruishi taru****@users*****
2004年 10月 8日 (金) 16:32:04 JST


===================================================================
RCS file: ultrapossum/module/failover/11failover,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ultrapossum/module/failover/11failover	2004/10/08 06:40:20	1.8
+++ ultrapossum/module/failover/11failover	2004/10/08 07:32:04	1.9
@@ -61,8 +61,16 @@
 VFSTAB=$(ultrapossum_getconf VFSTAB "/etc/vfstab")
 
 if test `uname` != "SunOS"; then
-  NFSDIR=$(ultrapossum_getconf NFSDIR "`grep nfs $FSTAB | awk -F' ' '{print $2;}' | head -1`")
-  NFSDEVICE=$(ultrapossum_getconf NFSDEVICE "`grep nfs $FSTAB | awk -F' ' '{print $1;}' | head -1`")
+
+  NFSDIR=$(ultrapossum_getconf NFSDIR "`cat /proc/mounts | grep nfs | cut -d' ' -f2`")
+  if test "x$NFSDIR" = "x"; then
+    NFSDIR="`grep nfs $FSTAB | awk -F' ' '{print $2;}' | head -1`"
+  fi
+  
+  NFSDEVICE=$(ultrapossum_getconf NFSDEVICE "`cat /proc/mounts | grep nfs | cut -d' ' -f1`")
+  if test "x$NFSDEVICE" = "x"; then
+    NFSDEVICE="`grep nfs $FSTAB | awk -F' ' '{print $1;}' | head -1`"
+  fi
 else
   NFSDIR=$(ultrapossum_getconf NFSDIR "`grep nfs $VFSTAB | awk -F' ' '{print $3;}' | head -1`")
   NFSDEVICE=$(ultrapossum_getconf NFSDEVICE "`grep nfs $VFSTAB | awk -F' ' '{print $1;}' | head -1`")
@@ -79,6 +87,9 @@
 if test "x$BACKUP" != "x" && test "x$NFSDIR" != "x"; then
   LOCAL_REPLOGFILE=$REPLOGFILE
   REPLOGFILE=$NFSDIR/$RPLDIR/$HOST/replog
+  SLURPDRPLDIR=$NFSDIR/$RPLDIR/$HOST
+else
+  SLURPDRPLDIR=$RPLDIR
 fi
 
 if test "x$SLAVES$BACKUP" != "x"; then
@@ -209,9 +220,8 @@
 }
 
 ldapslurp_start() {
-  rpldir="$NFSDIR/$RPLDIR/$HOST"
-  install -d $rpldir
-  $SLURPD -d $SLURPD_DEBUGLEVEL -f $ULTRAPOSSUM_MASTER_SLAPD_CONF -t $rpldir $SLURPD_EXTRA_ARGS &
+  install -d $SLURPDRPLDIR
+  $SLURPD -d $SLURPD_DEBUGLEVEL -f $ULTRAPOSSUM_MASTER_SLAPD_CONF -t $SLURPDRPLDIR $SLURPD_EXTRA_ARGS &
   echo $! > $SLURPD_PIDFILE
   $MODULEDIR/server/pid wait $SLURPD_PIDFILE
   echo -n " `basename $SLURPD`"
===================================================================
RCS file: ultrapossum/module/failover/failover.cf,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ultrapossum/module/failover/failover.cf	2004/10/08 06:40:20	1.7
+++ ultrapossum/module/failover/failover.cf	2004/10/08 07:32:04	1.8
@@ -13,12 +13,11 @@
 # NFS device
 #NFSDEVICE="nfs:/nfs"
 
-# NFS mount point for data consistency
+# NFS mount point for data consistency.
+# The replication log will be written under $NFSDIR/$RPLDIR
+# in failover environment.
 #NFSDIR="/var/autofs/misc/share"
 
-# Replication Log Directory
-#RPLDIR="/service/ldap"
-
 ###
 ### Service Monitoring Configuration
 ###
@@ -36,6 +35,7 @@
 ###
 ### Load Balancer Configuration
 ###
-									      # Load Balancer IP address
+
+# Load Balancer IP address
 #LOADBALANCER="192.168.0.254"
 
===================================================================
RCS file: ultrapossum/module/failover/update-failover,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ultrapossum/module/failover/update-failover	2004/10/08 06:40:20	1.16
+++ ultrapossum/module/failover/update-failover	2004/10/08 07:32:04	1.17
@@ -116,7 +116,9 @@
   if test `uname` = "SunOS"; then
     :
   else
-    if test "x$BACKUP" != "x" && ! grep $NFSDIR $FSTAB > /dev/null 2> /dev/null; then
+    if test "x$BACKUP" != "x" &&
+    	! grep "$NFSDEVICE" $FSTAB 2> /dev/null | grep "$NFSDIR" > /dev/null
+    then
       if test "x$NFSDIR" = "x" || test "x$NFSDEVICE" = "x"; then
         echo "E: No NFS configuration in $FSTAB" 1>&2
 	exit 1
@@ -131,7 +133,8 @@
     :
   else
     if test "x$BACKUP" != "x" && test "x$TYPE" = "xmaster"; then
-      if ! grep $NFSDIR $FSTAB > /dev/null 2> /dev/null; then
+      if ! grep "$NFSDEVICE" $FSTAB 2> /dev/null | grep "$NFSDIR" > /dev/null
+      then
         add_startmark "##" "FAILOVER" > $tmp
         echo "$NFSDEVICE	$NFSDIR	nfs	rw	0	0" >> $tmp
         add_endmark "##" "FAILOVER" >> $tmp



Ultrapossum-cvs メーリングリストの案内
Zurück zum Archiv-Index