[Ocfs2-tools-commits] jlbec commits r1137 - in branches/ocfs2-tools-1.0: . debian vendor/common

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Nov 22 15:03:51 CST 2005


Author: jlbec
Date: 2005-11-22 15:03:49 -0600 (Tue, 22 Nov 2005)
New Revision: 1137

Added:
   branches/ocfs2-tools-1.0/debian/copyright
Removed:
   branches/ocfs2-tools-1.0/debian/ocfs2-tools.copyright
   branches/ocfs2-tools-1.0/debian/ocfs2console.copyright
Modified:
   branches/ocfs2-tools-1.0/Makefile
   branches/ocfs2-tools-1.0/debian/control
   branches/ocfs2-tools-1.0/debian/rules
   branches/ocfs2-tools-1.0/vendor/common/Makefile
   branches/ocfs2-tools-1.0/vendor/common/o2cb.init
   branches/ocfs2-tools-1.0/vendor/common/ocfs2-tools.spec.in
   branches/ocfs2-tools-1.0/vendor/common/ocfs2.init
Log:

o Merged r1110 from trunk
	[1110] - Make ocfs2.init be distro agnostic.



Modified: branches/ocfs2-tools-1.0/Makefile
===================================================================
--- branches/ocfs2-tools-1.0/Makefile	2005-11-19 01:08:41 UTC (rev 1136)
+++ branches/ocfs2-tools-1.0/Makefile	2005-11-22 21:03:49 UTC (rev 1137)
@@ -43,13 +43,12 @@
 	debian/changelog			\
 	debian/compat				\
 	debian/control				\
-	debian/ocfs2-tools.copyright		\
+	debian/copyright			\
 	debian/ocfs2-tools.docs			\
 	debian/ocfs2-tools.install		\
 	debian/ocfs2-tools.manpages		\
 	debian/ocfs2-tools.postinst		\
 	debian/ocfs2-tools.prerm		\
-	debian/ocfs2console.copyright		\
 	debian/ocfs2console.install		\
 	debian/ocfs2console.manpages		\
 	debian/ocfs2console.postinst		\

Modified: branches/ocfs2-tools-1.0/debian/control
===================================================================
--- branches/ocfs2-tools-1.0/debian/control	2005-11-19 01:08:41 UTC (rev 1136)
+++ branches/ocfs2-tools-1.0/debian/control	2005-11-22 21:03:49 UTC (rev 1137)
@@ -2,7 +2,7 @@
 Section: admin
 Priority: optional
 Maintainer: Joel Becker <joel.becker at oracle.com>
-Standards-Version: 3.5.6
+Standards-Version: 3.6.1
 Build-Depends: python-gtk2 (>= 2.0), python (>= 2.3), python (<< 2.4), python2.3-dev, libglib2.0-dev (>= 2.2.3), libreadline5-dev, comerr-dev, uuid-dev, libblkid-dev (>= 1.36), debhelper (>= 3.0.5)
 
 Package: ocfs2-tools

Copied: branches/ocfs2-tools-1.0/debian/copyright (from rev 1110, trunk/debian/copyright)

Deleted: branches/ocfs2-tools-1.0/debian/ocfs2-tools.copyright
===================================================================
--- branches/ocfs2-tools-1.0/debian/ocfs2-tools.copyright	2005-11-19 01:08:41 UTC (rev 1136)
+++ branches/ocfs2-tools-1.0/debian/ocfs2-tools.copyright	2005-11-22 21:03:49 UTC (rev 1137)
@@ -1,17 +0,0 @@
-Copyright (C) 2004,2005 Oracle, All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License with
-your Debian GNU/Linux system, in /usr/share/common-licenses/GPL, or
-with the Debian GNU/Linux hello source package as the file COPYING.  
-If not, write to the Free Software Foundation, Inc., 59 Templ Place -
-Suite 330, Boston, MA 02111-1307, USA.
-

Deleted: branches/ocfs2-tools-1.0/debian/ocfs2console.copyright
===================================================================
--- branches/ocfs2-tools-1.0/debian/ocfs2console.copyright	2005-11-19 01:08:41 UTC (rev 1136)
+++ branches/ocfs2-tools-1.0/debian/ocfs2console.copyright	2005-11-22 21:03:49 UTC (rev 1137)
@@ -1,19 +0,0 @@
-Program Copyright (C) 2005 Oracle Corporation,
-Joel Becker <joel.becker at oracle.com>.
-All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License with
-your Debian GNU/Linux system, in /usr/share/common-licenses/GPL, or
-with the Debian GNU/Linux hello source package as the file COPYING.  
-If not, write to the Free Software Foundation, Inc., 59 Templ Place -
-Suite 330, Boston, MA 02111-1307, USA.
-

Modified: branches/ocfs2-tools-1.0/debian/rules
===================================================================
--- branches/ocfs2-tools-1.0/debian/rules	2005-11-19 01:08:41 UTC (rev 1136)
+++ branches/ocfs2-tools-1.0/debian/rules	2005-11-22 21:03:49 UTC (rev 1137)
@@ -29,6 +29,7 @@
 
 	rm -f debian/ocfs2-tools.o2cb.init
 	rm -f debian/ocfs2-tools.o2cb.default
+	rm -f debian/ocfs2-tools.ocfs2.init
 	dh_clean
 
 install: DH_OPTIONS=
@@ -40,6 +41,7 @@
 
 	cp -f vendor/common/o2cb.init debian/ocfs2-tools.o2cb.init
 	cp -f vendor/common/o2cb.sysconfig debian/ocfs2-tools.o2cb.default
+	cp -f vendor/common/ocfs2.init debian/ocfs2-tools.ocfs2.init
 
 	$(MAKE) DESTDIR=`pwd`/debian/tmp install
 
@@ -65,7 +67,8 @@
 #	dh_installemacsen
 #	dh_installpam
 #	dh_installmime
-	dh_installinit --name=o2cb
+	dh_installinit --name=o2cb -r
+	dh_installinit --name=ocfs2 -r
 	dh_installman
 #	dh_installcron
 #	dh_installinfo

Modified: branches/ocfs2-tools-1.0/vendor/common/Makefile
===================================================================
--- branches/ocfs2-tools-1.0/vendor/common/Makefile	2005-11-19 01:08:41 UTC (rev 1136)
+++ branches/ocfs2-tools-1.0/vendor/common/Makefile	2005-11-22 21:03:49 UTC (rev 1137)
@@ -2,6 +2,6 @@
 
 include $(TOPDIR)/Preamble.make
 
-DIST_FILES = o2cb.init o2cb.sysconfig ocfs2-tools.spec.in
+DIST_FILES = o2cb.init o2cb.sysconfig ocfs2.init ocfs2-tools.spec.in
 
 include $(TOPDIR)/Postamble.make

Modified: branches/ocfs2-tools-1.0/vendor/common/o2cb.init
===================================================================
--- branches/ocfs2-tools-1.0/vendor/common/o2cb.init	2005-11-19 01:08:41 UTC (rev 1136)
+++ branches/ocfs2-tools-1.0/vendor/common/o2cb.init	2005-11-22 21:03:49 UTC (rev 1137)
@@ -1,12 +1,12 @@
 #!/bin/sh
 # init fragment for O2CB.
 #
-# chkconfig: 2435 24 20
+# chkconfig: 2345 24 20
 # description: Load O2CB cluster services at system boot.
 #
 ### BEGIN INIT INFO
 # Provides: o2cb
-# Required-Start: 
+# Required-Start: $network
 # Should-Start:
 # Required-Stop:
 # Default-Start: 2 3 5

Modified: branches/ocfs2-tools-1.0/vendor/common/ocfs2-tools.spec.in
===================================================================
--- branches/ocfs2-tools-1.0/vendor/common/ocfs2-tools.spec.in	2005-11-19 01:08:41 UTC (rev 1136)
+++ branches/ocfs2-tools-1.0/vendor/common/ocfs2-tools.spec.in	2005-11-22 21:03:49 UTC (rev 1137)
@@ -54,6 +54,13 @@
 
 mkdir -p $RPM_BUILD_ROOT/etc/init.d
 cp -f vendor/common/o2cb.init $RPM_BUILD_ROOT/etc/init.d/o2cb
+cp -f vendor/common/ocfs2.init $RPM_BUILD_ROOT/etc/init.d/ocfs2
+if [ -f /etc/redhat-release ]
+then
+    # Red Hat chkconfig is completely and utterly broken
+    perl -p -i -e 'BEGIN() { $k=0;}  if (/^###/) { $k++ } elsif ($k == 1) { printf "#"};' $RPM_BUILD_ROOT/etc/init.d/o2cb
+    perl -p -i -e 'BEGIN() { $k=0;}  if (/^###/) { $k++ } elsif ($k == 1) { printf "#"};' $RPM_BUILD_ROOT/etc/init.d/ocfs2
+fi
 mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
 cp -f vendor/common/o2cb.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/o2cb
 
@@ -70,8 +77,13 @@
 
 %post
 chkconfig o2cb on
+chkconfig --add ocfs2 >/dev/null
 
+%preun
+chkconfig --del ocfs2 >/dev/null
+chkconfig --del o2cb >/dev/null
 
+
 %files
 %defattr(-,root,root)
 %doc README.O2CB COPYING CREDITS MAINTAINERS
@@ -86,6 +98,7 @@
 /sbin/ocfs2cdsl
 /sbin/ocfs2_hb_ctl
 /etc/init.d/o2cb
+/etc/init.d/ocfs2
 /etc/sysconfig/o2cb
 /usr/share/man/man8/debugfs.ocfs2.8.gz
 /usr/share/man/man8/fsck.ocfs2.8.gz

Modified: branches/ocfs2-tools-1.0/vendor/common/ocfs2.init
===================================================================
--- branches/ocfs2-tools-1.0/vendor/common/ocfs2.init	2005-11-19 01:08:41 UTC (rev 1136)
+++ branches/ocfs2-tools-1.0/vendor/common/ocfs2.init	2005-11-22 21:03:49 UTC (rev 1137)
@@ -2,96 +2,172 @@
 # Copyright (c) 2005 Oracle
 # All rights reserved.
 #
-# /etc/init.d/ocfs2
+# chkconfig: 2345 25 19
+# description: Mount OCFS2 volumes at boot.
 #
 ### BEGIN INIT INFO
-# Provides:       ocfs2
-# Required-Start: $network $portmap o2cb
-# Required-Stop:
+# Provides: ocfs2
+# Required-Start: $network o2cb
+# Required-Stop: 
 # X-UnitedLinux-Should-Start:
 # X-UnitedLinux-Should-Stop:
-# Default-Start:  3 5
+# Default-Start:  2 3 5
 # Default-Stop:
-# Description:   Mounts OCFS2 volumes
+# Description:  Mount OCFS2 volumes at boot.
 ### END INIT INFO
 
+if [ -f /etc/redhat-release ]
+then
+. /etc/init.d/functions
+
+init_status()
+{
+    return 0
+}
+
+success_status()
+{
+    success
+    echo
+}
+
+failure_status()
+{
+    failure $1
+    echo
+}
+
+exit_status()
+{
+    exit $?
+}
+elif [ -f /etc/SuSE-release -o -f /etc/UnitedLinux-release ]
+then
 . /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`
+init_status()
+{
+    rc_reset
+}
+
+success_status()
+{
+    /bin/true
+    rc_status -v
+}
+
+failure_status()
+{
+    /bin/false
+    rc_status -v
+}
+
+exit_status()
+{
+    rc_exit
+}
+else
+init_status()
+{
+    return 0
+}
+
+success_status()
+{
+    echo "OK"
+    return 0
+}
+
+failure_status()
+{
+    echo "Failed"
+    return 0
+}
+
+exit_status()
+{
+    exit $?
+}
+fi
+
+ocfs2mounts()
+{
+    LC_ALL=C awk '$3 == "ocfs2"  { print $2 }' /proc/mounts
+}
+
+ocfs2fstab()
+{
+    LC_ALL=C awk '!/^#/ && $3 == "ocfs2" && $4 !~ /noauto/ { print $2 }' /etc/fstab
+}
+
+init_status
+
 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
-	;;
+        if [ -n "`ocfs2fstab`" ] ; then
+            echo -n "Starting Oracle Cluster File System (OCFS2) "
+            mount -at ocfs2
+            if [ $? = 0 ]
+            then
+                success_status
+            else
+                failure_status "Unable to mount OCFS2 filesystems"
+            fi
+        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
-	;;
+        echo -n "Stopping Oracle Cluster File System (OCFS2) "
+        remaining="`ocfs2mounts`"
+        sig=
+        retry=3
+        while [ -n "$remaining" -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
+
+            remaining="`ocfs2mounts`"
+            [ -z "$remaining" ] && break
+            failure_status "Unable to unmount OCFS2 filesystems"
+
+            $FUSER -km $sig $remaining >/dev/null
+            sleep 5
+            retry=$(($retry - 1))
+            sig=-9
+        done
+        [ -z "$remaining" ] && success_status
+        ;;
     restart|force-reload)
-	$0 stop
-	$0 start
-	rc_status
-	;;
+        $0 stop
+        $0 start
+        ;;
     status)
-	if [ -f /proc/mounts ] ; then
-		[ -n "$OCFS2FSTAB" ] && {
-			echo "Configured OCFS2 mountpoints: " $OCFS2FSTAB
-		}
+        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
-	;;
+            [ -n "`ocfs2mounts`" ] && {
+                echo "Active OCFS2 mountpoints: " `ocfs2mounts`
+            }
+        else
+            echo -n "Checking OCFS2 mountpoints: "
+            failure_status
+        fi
+        ;;
     try-restart|condrestart)
-	$0 status
-	if test $? = 0; then
-	    $0 restart
-	else
-	    rc_reset
-	fi
-	rc_status
-	;;
+        $0 status
+        if test $? = 0; then
+            $0 restart
+        fi
+        ;;
     *)
-	echo "Usage: $0 {start|stop|status|reload|force-reload|restart|try-restart}"
-	exit 1
+        echo "Usage: $0 {start|stop|status|reload|force-reload|restart|try-restart}"
+        exit 1
 esac
-rc_exit
+
+exit_status



More information about the Ocfs2-tools-commits mailing list