{
# Find the best TDB consistency check available.
use_tdb_tool_check=false
- if [ -x /usr/bin/tdbtool ] && \
- echo "help" | /usr/bin/tdbtool | grep -q check ; then
+ if which tdbtool >/dev/null 2>&1 && \
+ echo "help" | tdbtool | grep -q check ; then
use_tdb_tool_check=true
- elif [ -x /usr/bin/tdbtool -a -x /usr/bin/tdbdump ] ; then
+ elif which tdbtool >/dev/null 2>&1 && which tdbdump >/dev/null 2>&1 ; then
do_log <<EOF
WARNING: The installed 'tdbtool' does not offer the 'check' subcommand.
Using 'tdbdump' for database checks.
Consider updating 'tdbtool' for better checks!
EOF
- elif [ -x /usr/bin/tdbdump ] ; then
+ elif which tdbdump >/dev/null 2>&1 ; then
do_log <<EOF
WARNING: 'tdbtool' is not available.
Using 'tdbdump' to check the databases.
_timeout="${1:-10}" # default is 10 seconds
_count=0
- while ! ctdb ping >/dev/null 2>&1 ; do
+ while ! ctdb runstate startup running >/dev/null 2>&1 ; do
if [ $_count -ge $_timeout ] ; then
return 1
fi
# make sure we drop any ips that might still be held if previous
# instance of ctdb got killed with -9 or similar
- drop_all_public_ips
+ drop_all_public_ips "ctdb.init"
if select_tdb_checker ; then
check_persistent_databases || return $?
if [ $RETVAL -eq 0 ] ; then
if ! wait_until_ready ; then
RETVAL=1
+ echo "Timed out waiting for initialisation - killing CTDB"
pkill -9 -f $ctdbd >/dev/null 2>&1
fi
fi