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
This commit is contained in:
Jan Friesse 2010-08-02 12:38:19 +00:00
parent 93fb44ed0f
commit d6cd3b6b34

View File

@ -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