Page MenuHomeClusterLabs Projects

No OneTemporary

diff --git a/script/service-runnable b/script/service-runnable
index 96fa066..6c15d0d 100755
--- a/script/service-runnable
+++ b/script/service-runnable
@@ -1,35 +1,41 @@
#!/bin/bash
# This script is part of Booth.
# It checks whether the given resource (service) still has a chance
# to run on the local cluster, so that booth knows whether to
# acquire the ticket here.
set -e
service="${1:?Need a resource name as first argument.}"
tmpshadow=`mktemp booth-check.XXXXXX`
trap "rm -f $tmpshadow" EXIT
# We expect an output like
# p_dummy (ocf::pacemaker:Dummy): Started geo-rz2-a
if crm_simulate -O $tmpshadow --ticket-grant "$BOOTH_TICKET" --simulate --live-check |
sed -n '/^Revised cluster status:/,$p' |
egrep "^[[:space:]]+$service[[:space:]]+\(.*\):[[:space:]]+Started ([^[:space:]]+) *$" >/dev/null
then
# can be started - we're done.
exit 0
fi
+# If target-role is Stopped, it judges with being stopped explicitly.
+output=$(crm_resource --meta --get-parameter="target-role" --resource=$service 2>/dev/null)
+rc=$?
+if [ $rc == 0 -a "$output" = "Stopped" ]; then
+ exit 0
+fi
# Some error occured.
# Try to help the admin with a bit of diagnostic.
#
# disallow ms-resources, ie. only primitives wanted here
if ! crm_resource -l | grep -v ":" | grep "$service" ; then
ha_logger "Defined resource '$service' in $BOOTH_CONF_PATH is not a primitive??"
fi
exit 1

File Metadata

Mime Type
text/x-diff
Expires
Sat, Jan 25, 7:09 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1321058
Default Alt Text
(1 KB)

Event Timeline