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

Back to archive index

Masato Taruishi taru****@users*****
2004年 10月 13日 (水) 20:45:18 JST


===================================================================
RCS file: ultrapossum/module/failover/nfs.monitor,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ultrapossum/module/failover/nfs.monitor	2004/10/13 11:16:15	1.6
+++ ultrapossum/module/failover/nfs.monitor	2004/10/13 11:45:18	1.7
@@ -17,10 +17,17 @@
 
 # $Id$
 
-eval `ultrapossum-config init`
-trap "eval `ultrapossum-config term`" 0
+set -e
 
-pidfile=$FAILOVER_STATUSCPY_PIDFILE
+if test "x$4" = "x"; then
+  echo "Usage: $0 <from> <to> <agent> <pidfile> <host>" 1>&2
+  exit 1
+fi
+
+status=$1
+backup=$2
+agent=$3
+pidfile=$4
 
 if [ -f $pidfile ]; then
     pid=`cat $pidfile`
@@ -31,7 +38,7 @@
           if [ ! -d /proc/$pid ]; then
             exit 0;
           fi
-     	  logger -p user.err "Warning: statuscpy runs slowly $i times"
+     	  logger -p user.err "Warning: $3 runs slowly $i times"
         done
 	if [ -d /proc/$pid ]; then
     	     echo "Can't connect NFS."
@@ -39,14 +46,10 @@
              rm -f $pidfile
     	     exit 1
         fi
-    	logger -p user.err "Warning: statuscpy completed"
+    	logger -p user.err "Warning: $3 completed"
     fi
 fi
 
-backup="$NFSDIR/$RPLDIR/backup/slurpd.status"
-pidfile="$FAILOVER_STATUSCPY_PIDFILE"
-status="$SLURPDRPLDIR/replica/slurpd.status"
-
-sudo $MODULEDIR/failover/statuscpy $status $backup $pidfile 2>&1 | logger -p user.err &
+sudo $agent $status $backup $pidfile 2>&1 | logger -p user.err &
 
 exit 0
===================================================================
RCS file: ultrapossum/module/failover/ultrapossum.mon.cf.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ultrapossum/module/failover/ultrapossum.mon.cf.in	2004/10/13 10:59:53	1.5
+++ ultrapossum/module/failover/ultrapossum.mon.cf.in	2004/10/13 11:45:18	1.6
@@ -19,7 +19,7 @@
 			numalerts 1
 	service nfs
 		interval 20s
-		monitor nfs.monitor
+		monitor nfs.monitor #SLURPDRPLDIR#/replica/slurpd.status #NFSDIR#/#RPLDIR#/backup/slurpd.status #MODULEDIR#/failover/statuscpy #FAILOVER_STATUSCPY_PIDFILE#
 		period wd {Sun-Sat}
 			alert failover.alert
 			alert test.alert
===================================================================
RCS file: ultrapossum/module/failover/update-failover,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ultrapossum/module/failover/update-failover	2004/10/13 11:00:07	1.22
+++ ultrapossum/module/failover/update-failover	2004/10/13 11:45:18	1.23
@@ -34,11 +34,7 @@
   if test "x$TYPE" = "xmaster" && test "x$BACKUP" != "x"; then
     progress "Configuring mon... "
     add_startmark "##" $monid > $ULTRAPOSSUM_MON_CF
-    sed -e "s/#ROOTDN#/$ROOTDN/" -e "s/#LOADBALANCER#/$LOADBALANCER/" \
-      -e "s/#HOST#/$HOST/" \
-      -e "s/#FAILOVER_LDAP_INTERVAL#/$FAILOVER_LDAP_INTERVAL/" \
-      -e "s/#FAILOVER_LDAP_FAILURE_INTERVAL#/$FAILOVER_LDAP_FAILURE_INTERVAL/" \
-      -e "s/#FAILOVER_LDAP_ALERTAFTER#/$FAILOVER_LDAP_ALERTAFTER/" \
+    $SHAREDIR/sedwrap \
        < $ULTRAPOSSUM_MON_CFIN >> $ULTRAPOSSUM_MON_CF
     add_endmark "##" $monid >> $ULTRAPOSSUM_MON_CF
     add_end_vaconf $MONCF $ULTRAPOSSUM_MON_CF $monid



Ultrapossum-cvs メーリングリストの案内
Back to archive index