server: start with disabled interfaces and let the event scripts enable the interface...
authorStefan Metzmacher <metze@samba.org>
Mon, 21 Dec 2009 18:18:10 +0000 (19:18 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 20 Jan 2010 10:11:01 +0000 (11:11 +0100)
This makes sure that we don't get public addresses assigned during the
initial recovery and remove them again in the startup event.

metze

(This used to be ctdb commit f872e8c63a2f8979e6a0d088630575bdd4d7b4f1)

ctdb/server/ctdb_takeover.c
ctdb/tests/events.d/00.test

index 7c26d3787ff240befd4167807e9d4722bf93a102..a924cc76b9930f99028f1005208a131766312b91 100644 (file)
@@ -65,7 +65,7 @@ static int ctdb_add_local_iface(struct ctdb_context *ctdb, const char *iface)
        CTDB_NO_MEMORY_FATAL(ctdb, i);
        i->name = talloc_strdup(i, iface);
        CTDB_NO_MEMORY(ctdb, i->name);
-       i->link_up = true;
+       i->link_up = false;
 
        DLIST_ADD(ctdb->ifaces, i);
 
index 877e47b6ef15a9115c42f76ed8861422f5ae30cc..d2dcf0a95f15958a41705917ed45245c52b820ce 100755 (executable)
@@ -22,7 +22,12 @@ case $cmd in
        ;;
      startup)
        echo "ctdb startup event"
-       exit 0; 
+       IFACES=`ctdb ifaces -Y | grep -v '^:Name:LinkStatus:References:'`
+       for I in $IFACES; do
+               IFACE=`echo -n "$I" | cut -d ':' -f2`
+               ctdb setifacelink $IFACE up
+       done
+       exit 0;
        ;;
        
      takeip)