[Cluster-devel] cluster/cman/init.d cman

rpeterso at sourceware.org rpeterso at sourceware.org
Thu Jul 20 20:19:49 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rpeterso at sourceware.org	2006-07-20 20:19:47

Modified files:
	cman/init.d    : cman 

Log message:
	Service stop was killing daemons, which hung system at umount time.
	Also, service status would hang when cluster was down.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.17&r2=1.18

--- cluster/cman/init.d/cman	2006/06/29 18:58:31	1.17
+++ cluster/cman/init.d/cman	2006/07/20 20:19:47	1.18
@@ -44,7 +44,6 @@
 {
     errmsg=$( /sbin/modprobe configfs 2>&1 ) || return 1
     errmsg=$( /sbin/modprobe dlm 2>&1 ) || return 1
-    errmsg=$( /sbin/modprobe dlm_device 2>&1 ) || return 1
     errmsg=$( /sbin/modprobe lock_dlm 2>&1 ) || return 1
     return 0
 }
@@ -69,6 +68,8 @@
     if [ $? -ne 0 ]
     then
 	errmsg=$(/sbin/ccsd $CCSD_OPTS 2>&1)
+	# give ccsd time to start up before we start cman
+	sleep 1
 	return $?
     fi
     return 0
@@ -186,16 +187,16 @@
 stop_daemons()
 {
     if pid=$(/sbin/pidof gfs_controld 2>&1); then
-	errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+	errmsg=$(/usr/bin/kill $pid 2>&1) || return 1
     fi
     if pid=$(/sbin/pidof dlm_controld 2>&1); then
-	errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+	errmsg=$(/usr/bin/kill $pid 2>&1) || return 1
     fi
     if pid=$(/sbin/pidof fenced 2>&1); then
-	errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+	errmsg=$(/usr/bin/kill $pid 2>&1) || return 1
     fi
     if pid=$(/sbin/pidof groupd 2>&1); then
-	errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+	errmsg=$(/usr/bin/kill $pid 2>&1) || return 1
     fi
     return 0 # all ok
 }
@@ -213,16 +214,16 @@
 stop()
 {
     echo -n "Stopping cluster: "
-    stop_fence
-    [ $? -ne 0 ] && return 1
-    stop_daemons
-    [ $? -ne 0 ] && return 1
     if [ $1 ]; then
 	stop_cman $1
     else
 	stop_cman
     fi
     [ $? -ne 0 ] && return 1
+#    stop_daemons
+#    [ $? -ne 0 ] && return 1
+    stop_fence
+#    [ $? -ne 0 ] && return 1
     stop_ccsd
     [ $? -ne 0 ] && return 1
     stop_configfs
@@ -230,6 +231,16 @@
     return 0
 }
 
+cmanstatus()
+{
+	errmsg=$( status ccsd 2>&1) || return 1
+	errmsg=$( status groupd 2>&1) || return 1
+	errmsg=$( status fenced 2>&1) || return 1
+	errmsg=$( status dlm_controld 2>&1) || return 1
+	errmsg=$( status gfs_controld 2>&1) || return 1
+	return 0
+}
+
 rtrn=1
 
 # See how we were called.
@@ -274,8 +285,13 @@
 	;;
 
     status)
-	/sbin/cman_tool status 2>/dev/null
+	cmanstatus
 	rtrn=$?
+	if [ $rtrn -ne 0 ] ; then
+	    echo $errmsg
+	else
+	    echo "cman is running."
+	fi
 	;;
 
     *)




More information about the Cluster-devel mailing list