[Ocfs2-tools-commits] smushran commits r1108 - in branches/ocfs2-tools-1.2: extras vendor/common

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Nov 2 13:46:01 CST 2005


Author: smushran
Date: 2005-11-02 13:45:59 -0600 (Wed, 02 Nov 2005)
New Revision: 1108

Added:
   branches/ocfs2-tools-1.2/vendor/common/ocfs2.init
Removed:
   branches/ocfs2-tools-1.2/vendor/common/ocfs2fs
Modified:
   branches/ocfs2-tools-1.2/extras/watch-hb.sh
Log:
ocfs2.init added

Modified: branches/ocfs2-tools-1.2/extras/watch-hb.sh
===================================================================
--- branches/ocfs2-tools-1.2/extras/watch-hb.sh	2005-11-02 19:38:38 UTC (rev 1107)
+++ branches/ocfs2-tools-1.2/extras/watch-hb.sh	2005-11-02 19:45:59 UTC (rev 1108)
@@ -35,6 +35,6 @@
 	die "a region must be specified with -r or a device with -d"
 
 watch -n 3 -d \
-	"echo \"cat //heartbeat\" | debugfs.ocfs2 $device 2>/dev/null \
+	"echo \"cat //heartbeat\" | debugfs.ocfs2 -n $device 2>/dev/null \
 	| od -A d -x | \
 	awk '( NF > 2 ) { \$(1) = \$1 / $slot_bytes; if (\$1 == int(\$1)) print \$0 }'"

Added: branches/ocfs2-tools-1.2/vendor/common/ocfs2.init
===================================================================
--- branches/ocfs2-tools-1.2/vendor/common/ocfs2.init	2005-11-02 19:38:38 UTC (rev 1107)
+++ branches/ocfs2-tools-1.2/vendor/common/ocfs2.init	2005-11-02 19:45:59 UTC (rev 1108)
@@ -0,0 +1,97 @@
+#! /bin/bash
+# Copyright (c) 2005 Oracle
+# All rights reserved.
+#
+# /etc/init.d/ocfs2
+#
+### BEGIN INIT INFO
+# Provides:       ocfs2
+# Required-Start: $network $portmap o2cb
+# Required-Stop:
+# X-UnitedLinux-Should-Start:
+# X-UnitedLinux-Should-Stop:
+# Default-Start:  3 5
+# Default-Stop:
+# Description:   Mounts OCFS2 volumes
+### END INIT INFO
+
+. /etc/rc.status
+
+OCFS2MNTS=`LC_ALL=C awk '$3 == "ocfs2"  { print $2 }' /proc/mounts`
+OCFS2FSTAB=`LC_ALL=C awk '!/^#/ && $3 == "ocfs2" && $4 !~ /noauto/ { print $2 }' /etc/fstab`
+FUSER=`which fuser`
+
+rc_reset
+case "$1" in
+    start|reload)
+	echo -n "Starting Oracle Cluster File System (OCFS2)"
+	if [ -n "$OCFS2FSTAB" ] ; then
+	  mount -at ocfs2 2>/dev/null
+	  rc_status
+	  rc_status -v
+	else
+	  rc_status -u
+	fi
+	;;
+    stop)
+	echo -n "Stopping Oracle Cluster File System (OCFS2)"
+	ocfs2mnts=$OCFS2MNTS
+  	if [ -n "$ocfs2mnts" ] ; then
+		retry=3
+		while [ -n "$ocfs2mnts" -a "$retry" -gt 0 ]
+		do
+			if [ "$retry" -lt 3 ]; then
+				echo -n "Retry stopping Oracle Cluster File System (OCFS2)"
+			fi
+			umount -a -t ocfs2 2>/dev/null
+			sleep 1
+			ocfs2mnts=`LC_ALL=C awk '$3 == "ocfs2"  { print $2 }' /proc/mounts`
+			[ -z "$ocfs2mnts" ] && break
+			rc_failed 1
+			rc_status -v
+			$FUSER -km $ocfs2mnts >/dev/null
+			sleep 1
+			retry=$(($retry - 1))
+		done
+	fi
+	if [ -n "$ocfs2mnts" ] ; then
+		rc_failed 1
+	else
+		rc_failed 0
+	fi
+	rc_status -v
+	;;
+    restart|force-reload)
+	$0 stop
+	$0 start
+	rc_status
+	;;
+    status)
+	if [ -f /proc/mounts ] ; then
+		[ -n "$OCFS2FSTAB" ] && {
+			echo "Configured OCFS2 mountpoints: " $OCFS2FSTAB
+		}
+
+		[ -n "$OCFS2MNTS" ] && {
+			echo "Active OCFS2 mountpoints: " $OCFS2MNTS
+		}
+		rc_reset
+	else
+		rc_failed 3
+        	rc_status -v
+	fi
+	;;
+    try-restart|condrestart)
+	$0 status
+	if test $? = 0; then
+	    $0 restart
+	else
+	    rc_reset
+	fi
+	rc_status
+	;;
+    *)
+	echo "Usage: $0 {start|stop|status|reload|force-reload|restart|try-restart}"
+	exit 1
+esac
+rc_exit


Property changes on: branches/ocfs2-tools-1.2/vendor/common/ocfs2.init
___________________________________________________________________
Name: svn:executable
   + *

Deleted: branches/ocfs2-tools-1.2/vendor/common/ocfs2fs
===================================================================
--- branches/ocfs2-tools-1.2/vendor/common/ocfs2fs	2005-11-02 19:38:38 UTC (rev 1107)
+++ branches/ocfs2-tools-1.2/vendor/common/ocfs2fs	2005-11-02 19:45:59 UTC (rev 1108)
@@ -1,78 +0,0 @@
-#! /bin/bash
-# Copyright (c) 2005 Oracle
-# All rights reserved.
-#
-# /etc/init.d/ocfs2
-#
-### BEGIN INIT INFO
-# Provides:       ocfs2
-# Required-Start: $network $portmap o2cb
-# Required-Stop:
-# X-UnitedLinux-Should-Start:
-# X-UnitedLinux-Should-Stop:
-# Default-Start:  3 5
-# Default-Stop:
-# Description:   Mounts OCFS2 volumes
-### END INIT INFO
-
-. /etc/rc.status
-
-OCFS2MTAB=`LC_ALL=C awk '!/^#/ && $3 == "ocfs2"  { print $2 }' /proc/mounts`
-OCFS2FSTAB=`LC_ALL=C awk '!/^#/ && $3 == "ocfs2" && $4 !~ /noauto/ { print $2 }' /etc/fstab`
-
-rc_reset
-case "$1" in
-    start|reload)
-	echo -n "Starting Oracle Cluster File System (OCFS2)"
-	if [ -n "$OCFS2FSTAB" ] ; then
-	  mount -a -t ocfs2
-	  rc_status
-	  rc_status -v
-	else
-	  rc_status -u
-	fi
-	;;
-    stop)
-	echo -n "Stopping Oracle Cluster File System (OCFS2)"
-	if [ -n "$OCFS2MTAB" ] ; then
-	  umount -a -t ocfs2
-	  rc_status -v
-	else
-	  rc_status -u
-	fi
-	;;
-    restart|force-reload)
-	$0 stop
-	$0 start
-	rc_status
-	;;
-    status)
-	if [ -f /proc/mounts ] ; then
-		[ -n "$OCFS2FSTAB" ] && {
-			echo $"Configured OCFS2 mountpoints: "
-			for fs in $OCFS2FSTAB; do echo $fs ; done
-		}
-
-		[ -n "$OCFS2MTAB" ] && {
-			echo $"Active OCFS2 mountpoints: "
-			for fs in $OCFS2MTAB; do echo $fs ; done
-		}
-	else
-		rc_failed 3
-	fi
-        rc_status -v
-	;;
-    try-restart|condrestart)
-	$0 status
-	if test $? = 0; then
-	    $0 restart
-	else
-	    rc_reset
-	fi
-	rc_status
-	;;
-    *)
-	echo "Usage: $0 {start|stop|status|reload|force-reload|restart|try-restart}"
-	exit 1
-esac
-rc_exit



More information about the Ocfs2-tools-commits mailing list