瀏覽代碼

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 15 年之前
父節點
當前提交
d6cd3b6b34
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. 17 0
      init/generic.in

+ 17 - 0
init/generic.in

@@ -99,10 +99,27 @@ start()
 	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()
 {
 	! status $prog > /dev/null 2>&1 && return
 
+	! executed_by_cman && return
+
 	echo -n "Signaling $desc ($prog) to terminate: "
 	kill -TERM $(pidof $prog) > /dev/null 2>&1
 	success