[Ultrapossum-cvs 975] ultrapossum/module/failover 1.23, 1.24, update-failover

Zurück zum Archiv-Index

Masato Taruishi taru****@users*****
2004年 10月 22日 (金) 18:06:44 JST


===================================================================
RCS file: ultrapossum/module/failover/update-failover,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ultrapossum/module/failover/update-failover	2004/10/13 11:45:18	1.23
+++ ultrapossum/module/failover/update-failover	2004/10/22 09:06:44	1.24
@@ -29,24 +29,25 @@
 tmp=`tempfile`
 trap "rm -f $tmp; eval `ultrapossum-config term`" 0
 
+id="FAILOVER"
+
 configure_mon() {
-  monid="MON"
   if test "x$TYPE" = "xmaster" && test "x$BACKUP" != "x"; then
     progress "Configuring mon... "
-    add_startmark "##" $monid > $ULTRAPOSSUM_MON_CF
+    add_startmark "##" $id > $ULTRAPOSSUM_MON_CF
     $SHAREDIR/sedwrap \
        < $ULTRAPOSSUM_MON_CFIN >> $ULTRAPOSSUM_MON_CF
-    add_endmark "##" $monid >> $ULTRAPOSSUM_MON_CF
-    add_end_vaconf $MONCF $ULTRAPOSSUM_MON_CF $monid
+    add_endmark "##" $id >> $ULTRAPOSSUM_MON_CF
+    add_end_vaconf $MONCF $ULTRAPOSSUM_MON_CF $id
     progress "Configuring mon... done"
 
     if test "x$MONUSER" != "xroot"; then
       progress "Registering $MONUSER as sudoers... "
-      add_startmark "##" $monid > $tmp
+      add_startmark "##" $id > $tmp
       echo "$MONUSER ALL = (ALL) NOPASSWD: $MODULEDIR/server/startup" >> $tmp
       echo "$MONUSER ALL = (ALL) NOPASSWD: $MODULEDIR/failover/statuscpy" >> $tmp
-      add_endmark "##" $monid >> $tmp
-      add_end_vaconf $SUDOERS $tmp $monid
+      add_endmark "##" $id >> $tmp
+      add_end_vaconf $SUDOERS $tmp $id
       chmod 440 $SUDOERS
       progress "Registering $MONUSER as sudoers... done"
     else
@@ -79,7 +80,7 @@
     strip_vaconf $HACF "HACF"
 
     # ha.cf configuration
-    add_startmark "##" "HACF" > $tmp
+    add_startmark "##" $id > $tmp
     for n in $MASTER $BACKUP
     do
       if egrep "^node $n" $HACF > /dev/null; then
@@ -88,20 +89,18 @@
         echo "node $n" >> $tmp
       fi
     done
-    add_endmark "##" "HACF" >> $tmp
-    add_end_vaconf $HACF $tmp "HACF"
+    add_endmark "##" $id >> $tmp
+    add_end_vaconf $HACF $tmp $id
 
     # haresources configuration
-    if test "x$ULTRAPOSSUMMARK" = "xULTRAPOSSUM"; then
-      add_startmark "##" "HARESOURCES" > $tmp
-      if include "$BACKUP" "$SYNCBACKUPS"; then
-        echo "$MASTER syncbackup $VIRTUAL $ULTRAPOSSUMSERVICES" >> $tmp
-      else
-        echo "$MASTER $VIRTUAL $ULTRAPOSSUMSERVICES" >> $tmp
-      fi
-      add_endmark "##" "HARESOURCES" >> $tmp
-      add_end_vaconf $HARESOURCES $tmp "HARESOURCES"
+    add_startmark "##" $id > $tmp
+    if include "$BACKUP" "$SYNCBACKUPS"; then
+      echo "$MASTER syncbackup $VIRTUAL $ULTRAPOSSUMSERVICES" >> $tmp
+    else
+      echo "$MASTER $VIRTUAL $ULTRAPOSSUMSERVICES" >> $tmp
     fi
+    add_endmark "##" $id >> $tmp
+    add_end_vaconf $HARESOURCES $tmp $id
     if include "$BACKUP" "$SLURPDSLAVES"; then
       install -d $NFSDIR/$RPLDIR/$BACKUP
       install -d $NFSDIR/$RPLDIR/$MASTER
@@ -138,10 +137,10 @@
     if test "x$BACKUP" != "x" && test "x$TYPE" = "xmaster"; then
       if ! grep "$NFSDEVICE" $FSTAB 2> /dev/null | grep "$NFSDIR" > /dev/null
       then
-        add_startmark "##" "FAILOVER" > $tmp
+        add_startmark "##" $id > $tmp
         echo "$NFSDEVICE	$NFSDIR	$SHAREFSTYPE	rw	0	0" >> $tmp
-        add_endmark "##" "FAILOVER" >> $tmp
-        add_end_vaconf $FSTAB $tmp "FAILOVER"
+        add_endmark "##" $id >> $tmp
+        add_end_vaconf $FSTAB $tmp $id
       fi
     else
       remove_fstab



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