[SSI] openssi/nfs-utils.more SSInfs.init, NONE, 1.1.10.2 nfs.init, 1.1.15.1, 1.1.15.1.2.1 nfslock.init, 1.1.15.1, 1.1.15.1.2.1

Roger Tsang <[email protected]> Mon, 05 Jul 2010 02:57:05 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/nfs-utils.more
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv30252

Modified Files:
      Tag: OPENSSI-CENTOS
	nfs.init nfslock.init 
Added Files:
      Tag: OPENSSI-CENTOS
	SSInfs.init 
Log Message:
OpenSSI changes for CentOS


--- NEW FILE: SSInfs.init ---
#! /bin/sh
#
# SSInfs           This shell script takes care of starting and stopping
#               the NFS services in an SSI cluster.
#
# chkconfig: - 60 20
# SSIconfig: S initnode Y
# description: SSI nfs starter

# Source function library.
. /etc/rc.d/init.d/functions

SSI=n
if clusternode_num > /dev/null 2>&1 ; then
	SSI=y
fi

# On the base the regular nfs service will start by itself
if [ $SSI = "n" ];
then
	exit 0
fi

export SSINFS="y"

[ -e /proc/cluster/lvs ] || exit 0

NODE="`tail -1 /proc/cluster/lvs | awk '{ print $2 }'`"

# Background NFS start until all nodes are UP
if [ "$1" = "start" ];
then
	if [ ! -e /cluster/var/lock/subsys/L???ha-lvs ];
	then
		echo "NFS server requires CVIP through ha-lvs service"
		exit 1
	fi
	(
		while(`cluster -v | grep -q COMINGUP`)
		do
			sleep 5
		done
		onnode $NODE /etc/init.d/nfs $* > /dev/console 2>&1 < /dev/null
	) &
else
	onnode $NODE /etc/init.d/nfs $*
fi

if [ "$1" = "start" -o "$1" = "restart" ];
then
	touch /var/lock/subsys/SSInfs
fi

if [ "$1" = "stop" ];
then
	rm -f /var/lock/subsys/SSInfs
fi

exit 0

Index: nfs.init
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/nfs-utils.more/Attic/nfs.init,v
retrieving revision 1.1.15.1
retrieving revision 1.1.15.1.2.1
diff -u -d -r1.1.15.1 -r1.1.15.1.2.1
--- nfs.init	4 Jul 2010 22:42:11 -0000	1.1.15.1
+++ nfs.init	5 Jul 2010 02:57:03 -0000	1.1.15.1.2.1
@@ -13,6 +13,15 @@
 # Source function library.
 . /etc/rc.d/init.d/functions
 
+# Check whether this is OpenSSI
+if clusternode_num > /dev/null 2>&1 ; then
+	if [ "$SSINFS" = "" ];
+	then
+		echo "Skipping nfs service (starts from SSInfs)"
+		exit 0
+	fi
+fi
+
 # Source networking configuration.
 if [ ! -f /etc/sysconfig/network ]; then
     exit 0

Index: nfslock.init
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/nfs-utils.more/Attic/nfslock.init,v
retrieving revision 1.1.15.1
retrieving revision 1.1.15.1.2.1
diff -u -d -r1.1.15.1 -r1.1.15.1.2.1
--- nfslock.init	4 Jul 2010 22:42:11 -0000	1.1.15.1
+++ nfslock.init	5 Jul 2010 02:57:03 -0000	1.1.15.1.2.1
@@ -69,6 +69,12 @@
 		[ -n "$LOCKDARG" ]  && \
 			modprobe lockd $LOCKDARG
 	fi  
+	if clusternode_num > /dev/null 2>&1 ; then
+		thisnode="`clusternode_num`"
+		if [ "$thisnode" = "`cat /proc/1/where`" ] ; then
+			STATDARG="$STATDARG -C"
+		fi
+	fi
 	echo -n $"Starting NFS statd: "
 	# See if a statd's ports has been defined
 	[ -n "$STATD_PORT" ] && STATDARG="$STATDARG -p $STATD_PORT"


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first