From: Andrew Tridgell Date: Wed, 30 May 2007 06:11:39 +0000 (+1000) Subject: use our own netmask when deciding if we should takeover a IP, not the other nodes X-Git-Tag: tevent-0.9.20~348^2~2628 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d510ce3281982d18d224cd072a1086fd48e7d8c4;p=thirdparty%2Fsamba.git use our own netmask when deciding if we should takeover a IP, not the other nodes - check if ctdb dies while waiting for the startup event (This used to be ctdb commit 8b59f73c527a6d0a8abe8030dc3cbbc4329657be) --- diff --git a/ctdb/takeover/ctdb_takeover.c b/ctdb/takeover/ctdb_takeover.c index 5e4368c80c0..94ac1a4c737 100644 --- a/ctdb/takeover/ctdb_takeover.c +++ b/ctdb/takeover/ctdb_takeover.c @@ -318,8 +318,9 @@ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap) j != i; j=(j+1)%nodemap->num) { if ((nodemap->nodes[j].flags & NODE_FLAGS_CONNECTED) && - ctdb_same_subnet(ctdb->nodes[j]->public_address, ctdb->nodes[i]->public_address, - ctdb->nodes[i]->public_netmask_bits)) { + ctdb_same_subnet(ctdb->nodes[j]->public_address, + ctdb->nodes[i]->public_address, + ctdb->nodes[j]->public_netmask_bits)) { ctdb->nodes[i]->takeover_vnn = nodemap->nodes[j].vnn; break; } diff --git a/ctdb/tools/events b/ctdb/tools/events index 22b07429718..18d6fc9b2f3 100755 --- a/ctdb/tools/events +++ b/ctdb/tools/events @@ -18,6 +18,10 @@ case $cmd in /usr/bin/nc -z 127.0.0.1 $p || all_ok=0 done [ $all_ok -eq 1 ] || sleep 1 + /usr/bin/ctdb status > /dev/null 2>&1 || { + echo "ctdb daemon has died. Exiting event startup" + exit 1 + } done echo "Local tcp services on $CTDB_WAIT_TCP_PORTS are up" }