Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F5519494
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
821 B
Referenced Files
None
Subscribers
None
View Options
diff --git a/script/service-still-runnable b/script/service-still-runnable
new file mode 100755
index 0000000..a9f294a
--- /dev/null
+++ b/script/service-still-runnable
@@ -0,0 +1,23 @@
+#!/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.}"
+
+all_INF=1
+for eligible_node in `crm_node -p` ; do
+ stat=`crm_failcount -G -r "$service" -N "$eligible_node"`
+ if [[ "$stat" == "scope=status "*"name="*" value="* &&
+ "$stat" != *" value=INFINITY" ]] ; then
+ all_INF=0
+ fi
+done
+
+
+# if INFINITY on all nodes, the service can't run anywhere.
+# so tell booth to _not_ get the ticket.
+exit $all_INF
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Sep 5, 9:34 AM (12 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2308722
Default Alt Text
(821 B)
Attached To
Mode
rB Booth
Attached
Detach File
Event Timeline
Log In to Comment