From a515360eaf13282b96d0fe80e2c889554ceb1b4f Mon Sep 17 00:00:00 2001 From: Fabio M. Di Nitto Date: Oct 08 2012 16:27:02 +0000 Subject: fence_sanlock: don't restart fence_sanlockd if it's already running Signed-off-by: Fabio M. Di Nitto --- diff --git a/fence_sanlock/fence_sanlock.in b/fence_sanlock/fence_sanlock.in index 2ed667f..6090923 100755 --- a/fence_sanlock/fence_sanlock.in +++ b/fence_sanlock/fence_sanlock.in @@ -159,17 +159,13 @@ verify_device() { action_on() { verify_device || return 1 - pid="$(pidof fence_sanlockd)" - [ -n "$pid" ] && { - kill $pid - sleep 2 - } - - daemonerr="$(fence_sanlockd -d $device -i $host_id 2>&1)" - [ "$?" != 0 ] && { - echo "Unable to execute fence_sanlockd. Error:" - echo "$daemonerr" - return 1 + [ -z "$(pidof fence_sanlockd)" ] && { + daemonerr="$(fence_sanlockd -d $device -i $host_id 2>&1)" + [ "$?" != 0 ] && { + echo "Unable to execute fence_sanlockd. Error:" + echo "$daemonerr" + return 1 + } } # wait for fence_sanlockd to acquire the local lease;