1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-10 13:57:47 +03:00
samba-mirror/ctdb/tests/start_daemons.sh
Ronnie Sahlberg a8cf6e7914 create the nodes file in a 'test' subdirectory and not the current directory
delete all persistent databases when the test starts
(the tests only uses test databases in a special test directory)

do not set up any public addresses in the tests

wait until there are no disconnected or unhealthy nodes when starting the
test daemons instead of waiting for the recovery mode to change.
we do want to wait until the system has recovered and ALL nodes are ok.

(This used to be ctdb commit dfe0c44c1e8e9dab790686c5ba798986d04bf218)
2008-06-03 18:14:54 +10:00

38 lines
834 B
Bash
Executable File

#!/bin/sh
NUMNODES=2
if [ $# -gt 0 ]; then
NUMNODES=$1
fi
NODES="./tests/nodes.txt"
shift
rm -f $NODES
for i in `seq 1 $NUMNODES`; do
echo 127.0.0.$i >> $NODES
done
killall -q ctdbd
rm -rf test.db/persistent/*
CTDB_OPTIONS="--reclock=rec.lock --nlist $NODES --event-script-dir=tests/events.d --logfile=- -d 0 --dbdir=test.db --dbdir-persistent=test.db/persistent $*"
echo "Starting $NUMNODES ctdb daemons"
for i in `seq 1 $NUMNODES`; do
if [ `id -u` -eq 0 ]; then
CTDB_OPTIONS="$CTDB_OPTIONS --public-interface=lo"
fi
$VALGRIND bin/ctdbd --socket=sock.$i $CTDB_OPTIONS || exit 1
done
ln -sf $PWD/sock.1 /tmp/ctdb.socket || exit 1
while bin/ctdb status | egrep "DISCONNECTED|UNHEALTHY" > /dev/null; do
echo "`date` Waiting for recovery"
sleep 1;
done
echo "$NUMNODES daemons started"
exit 0