Masato Taruishi
taru****@users*****
2004年 10月 13日 (水) 20:00:07 JST
=================================================================== RCS file: ultrapossum/module/failover/11failover,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ultrapossum/module/failover/11failover 2004/10/13 03:20:15 1.14 +++ ultrapossum/module/failover/11failover 2004/10/13 11:00:07 1.15 @@ -61,21 +61,31 @@ FSTAB=$(ultrapossum_getconf FSTAB "/etc/fstab") VFSTAB=$(ultrapossum_getconf VFSTAB "/etc/vfstab") +SHAREFSTYPE=$(ultrapossum_getconf SHAREFSTYPE "nfs") -if test `uname` != "SunOS"; then +if test "$UNAME" != "SunOS"; then - NFSDIR=$(ultrapossum_getconf NFSDIR "`cat /proc/mounts | grep nfs | cut -d' ' -f2 | head -1`") + c="`cat /proc/mounts | grep ' $SHAREFSTYPE ' | head -1`" + f="`grep $SHAREFSTYPE $FSTAB | head -1`" + + NFSDIR=$(ultrapossum_getconf NFSDIR "`echo $c | cut -d' ' -f2`") if test "x$NFSDIR" = "x"; then - NFSDIR="`grep nfs $FSTAB | awk -F' ' '{print $2;}' | head -1`" + NFSDIR="`echo $f | awk -F' ' '{print $2;}'`" fi - NFSDEVICE=$(ultrapossum_getconf NFSDEVICE "`cat /proc/mounts | grep nfs | cut -d' ' -f1 | head -1`") + NFSDEVICE=$(ultrapossum_getconf NFSDEVICE "`echo $c | cut -d' ' -f1`") if test "x$NFSDEVICE" = "x"; then - NFSDEVICE="`grep nfs $FSTAB | awk -F' ' '{print $1;}' | head -1`" + NFSDEVICE="`echo $f | awk -F' ' '{print $1;}'`" + fi + + SHAREFSOPTIONS=$(ultrapossum_getconf SHAREFSOPTIONS "`echo $c | cut -d' ' -f4`") + if test "x$SHAREFSOPTIONS" = "x"; then + SHAREFSOPTIONS="`echo $f | awk -F' ' '{print $4;}'`" 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`") + NFSDIR=$(ultrapossum_getconf NFSDIR "`grep $SHAREFSTYPE $VFSTAB | awk -F' ' '{print $3;}' | head -1`") + NFSDEVICE=$(ultrapossum_getconf NFSDEVICE "`grep $SHAREFSTYPE $VFSTAB | awk -F' ' '{print $1;}' | head -1`") fi BACKUP=$(ultrapossum_getconf BACKUP "") =================================================================== RCS file: ultrapossum/module/failover/nfs.monitor,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ultrapossum/module/failover/nfs.monitor 2004/10/12 13:24:50 1.3 +++ ultrapossum/module/failover/nfs.monitor 2004/10/13 11:00:07 1.4 @@ -21,8 +21,6 @@ trap "eval `ultrapossum-config term`" 0 pidfile=$FAILOVER_STATUSCPY_PIDFILE -#prefix=/usr/local -#pidfile=$prefix/var/run/statuscpy.pid if [ -f $pidfile ]; then pid=`cat $pidfile` =================================================================== RCS file: ultrapossum/module/failover/recovery,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ultrapossum/module/failover/recovery 2004/10/10 19:45:02 1.9 +++ ultrapossum/module/failover/recovery 2004/10/13 11:00:07 1.10 @@ -82,13 +82,17 @@ # import master data if [ $needrecover -gt 0 ]; then + echo -n "Preparing recovery replication log... " 1>&2 mkdir $TMPDIR/$TMPRPL - cp -r $RPLDIR/$OWN/replica $TMPDIR/$TMPRPL + /bin/cp -r $RPLDIR/$OWN/replica $TMPDIR/$TMPRPL + echo -n "." 1>&2 cat $RPLDIR/$OWN/replog >> $TMPDIR/$TMPRPL/replica/slurpd.replog + echo -n "." 1>&2 if test "`$MODULEDIR/server/startup status`" = "stopped"; then $MODULEDIR/server/startup slave_start sleep 1 fi + echo "done" 1>&2 echo "Import master data" 1>&2 echo "replica: $TMPRPL/replica" 1>&2 echo "$SLURPD -d $SLURPD_DEBUGLEVEL -o -f $CONFDIR/recovery.conf -r $TMPDIR/$TMPRPL/replica/slurpd.replog -t $TMPDIR/$TMPRPL" 1>&2 =================================================================== RCS file: ultrapossum/module/failover/update-failover,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- ultrapossum/module/failover/update-failover 2004/10/12 13:24:50 1.21 +++ ultrapossum/module/failover/update-failover 2004/10/13 11:00:07 1.22 @@ -143,7 +143,7 @@ if ! grep "$NFSDEVICE" $FSTAB 2> /dev/null | grep "$NFSDIR" > /dev/null then add_startmark "##" "FAILOVER" > $tmp - echo "$NFSDEVICE $NFSDIR nfs rw 0 0" >> $tmp + echo "$NFSDEVICE $NFSDIR $SHAREFSTYPE rw 0 0" >> $tmp add_endmark "##" "FAILOVER" >> $tmp add_end_vaconf $FSTAB $tmp "FAILOVER" fi