Sfoglia il codice sorgente

Merge trunk revision 3011:
r3011 | honzaf | 2010-08-02 05:38:19 -0700 (Mon, 02 Aug 2010) | 5 lines

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/branches/flatiron@3026 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 15 anni fa
parent
commit
679294652f
1 ha cambiato i file con 17 aggiunte e 0 eliminazioni
  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