Explorar o código

Check that Corosync was not runned by cman

Patch fixes init script so it's tested, if corosync was runned
by cman or not. If so, it refuses to stop Corosync.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3011 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jan Friesse %!s(int64=15) %!d(string=hai) anos
pai
achega
d6cd3b6b34
Modificáronse 1 ficheiros con 17 adicións e 0 borrados
  1. 17 0
      init/generic.in

+ 17 - 0
init/generic.in

@@ -99,10 +99,27 @@ start()
 	echo
 	echo
 }
 }
 
 
+executed_by_cman()
+{
+	[ -f @LOCALSTATEDIR@/run/cman.pid ] || return 0
+
+	read cman_pid foo < @LOCALSTATEDIR@/run/cman.pid
+	if [ "$(pidof $prog)" == "$cman_pid" ];then
+		echo -n "$desc was executed by cman"
+		failure
+		echo
+		return 1
+	fi
+
+	return 0
+}
+
 stop()
 stop()
 {
 {
 	! status $prog > /dev/null 2>&1 && return
 	! status $prog > /dev/null 2>&1 && return
 
 
+	! executed_by_cman && return
+
 	echo -n "Signaling $desc ($prog) to terminate: "
 	echo -n "Signaling $desc ($prog) to terminate: "
 	kill -TERM $(pidof $prog) > /dev/null 2>&1
 	kill -TERM $(pidof $prog) > /dev/null 2>&1
 	success
 	success