]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
use our own netmask when deciding if we should takeover a IP, not the other nodes
authorAndrew Tridgell <tridge@samba.org>
Wed, 30 May 2007 06:11:39 +0000 (16:11 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 30 May 2007 06:11:39 +0000 (16:11 +1000)
- check if ctdb dies while waiting for the startup event

(This used to be ctdb commit 8b59f73c527a6d0a8abe8030dc3cbbc4329657be)

ctdb/takeover/ctdb_takeover.c
ctdb/tools/events

index 5e4368c80c025c5f2f185964affcd259191e94a0..94ac1a4c737acfbcb458c3b33a9c2e9e55c40281 100644 (file)
@@ -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;
                                }
index 22b0742971859d46a8f80b01d25bf0a47ba7a30d..18d6fc9b2f3221433ba5de99a6d1831ede678a1c 100755 (executable)
@@ -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"
        }