[Ocfs2-tools-commits] smushran commits r1106 - trunk/vendor/common
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Nov 2 13:37:01 CST 2005
Author: smushran
Date: 2005-11-02 13:36:59 -0600 (Wed, 02 Nov 2005)
New Revision: 1106
Added:
trunk/vendor/common/ocfs2.init
Removed:
trunk/vendor/common/ocfs2fs
Log:
ocfs2.init added
Added: trunk/vendor/common/ocfs2.init
===================================================================
--- trunk/vendor/common/ocfs2.init 2005-10-21 16:39:57 UTC (rev 1105)
+++ trunk/vendor/common/ocfs2.init 2005-11-02 19:36:59 UTC (rev 1106)
@@ -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: trunk/vendor/common/ocfs2.init
___________________________________________________________________
Name: svn:executable
+ *
Deleted: trunk/vendor/common/ocfs2fs
===================================================================
--- trunk/vendor/common/ocfs2fs 2005-10-21 16:39:57 UTC (rev 1105)
+++ trunk/vendor/common/ocfs2fs 2005-11-02 19:36:59 UTC (rev 1106)
@@ -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