summaryrefslogtreecommitdiffstats
path: root/ctdb/config/functions
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-06-17 11:57:42 +1000
committerAndrew Tridgell <tridge@samba.org>2007-06-17 11:57:42 +1000
commitd683080b08c03e720ecc10821f1580eabb7b8e47 (patch)
tree205bc7d43908c11a5896f6455136db4432f12e5a /ctdb/config/functions
parent97d5bea2eb4172f26af8cf9a0e83279627e2c700 (diff)
downloadsamba-d683080b08c03e720ecc10821f1580eabb7b8e47.tar.gz
samba-d683080b08c03e720ecc10821f1580eabb7b8e47.tar.xz
samba-d683080b08c03e720ecc10821f1580eabb7b8e47.zip
- wait for winbind on samba start
- use $PATH for ctdb status (This used to be ctdb commit cf8d837cead1cbcb22c71ebbc3947970d1a565a3)
Diffstat (limited to 'ctdb/config/functions')
-rw-r--r--ctdb/config/functions26
1 files changed, 24 insertions, 2 deletions
diff --git a/ctdb/config/functions b/ctdb/config/functions
index 4219f22383..ce292bc5fe 100644
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -26,6 +26,28 @@ service() {
fi
}
+
+######################################################
+# wait for a command to return a zero exit status
+# usage: ctdb_wait_command SERVICE_NAME <command>
+######################################################
+ctdb_wait_command() {
+ service_name="$1"
+ wait_cmd="$2"
+ [ -z "$wait_cmd" ] && return;
+ all_ok=0
+ echo "`/bin/date` Waiting for service $service_name to start"
+ while [ $all_ok -eq 0 ]; do
+ $wait_cmd > /dev/null 2>&1 && all_ok=1
+ ctdb status > /dev/null 2>&1 || {
+ echo "ctdb daemon has died. Exiting wait for $service_name"
+ exit 1
+ }
+ done
+ echo "`/bin/date` Local service $service_name is up"
+}
+
+
######################################################
# wait for a set of tcp ports
# usage: ctdb_wait_tcp_ports SERVICE_NAME <ports...>
@@ -50,7 +72,7 @@ ctdb_wait_tcp_ports() {
fi
done
[ $all_ok -eq 1 ] || sleep 1
- /usr/bin/ctdb status > /dev/null 2>&1 || {
+ ctdb status > /dev/null 2>&1 || {
echo "ctdb daemon has died. Exiting tcp wait $service_name"
exit 1
}
@@ -77,7 +99,7 @@ ctdb_wait_directories() {
[ -d $d ] || all_ok=0
done
[ $all_ok -eq 1 ] || sleep 1
- /usr/bin/ctdb status > /dev/null 2>&1 || {
+ ctdb status > /dev/null 2>&1 || {
echo "ctdb daemon has died. Exiting directory wait for $service_name"
exit 1
}