only run "serverid wipe" if we are actually running samba.
[sahlberg/ctdb.git] / server / ctdbd.c
index b0b075c4f31931de8f57028bd8fda5d08a9b9470..b90dbcdf1e41683d3f61e30bdb9bf0bf26689a45 100644 (file)
@@ -73,7 +73,7 @@ static void ctdb_recv_pkt(struct ctdb_context *ctdb, uint8_t *data, uint32_t len
 {
        struct ctdb_req_header *hdr = (struct ctdb_req_header *)data;
 
-       ctdb->statistics.node_packets_recv++;
+       CTDB_INCREMENT_STAT(ctdb, node_packets_recv);
 
        /* up the counter for this source node, so we know its alive */
        if (ctdb_validate_pnn(ctdb, hdr->srcnode)) {
@@ -178,6 +178,7 @@ int main(int argc, const char *argv[])
        fault_setup("ctdbd");
 
        ev = event_context_init(NULL);
+       tevent_loop_allow_nesting(ev);
 
        ctdb = ctdb_cmdline_init(ev);
 
@@ -194,6 +195,7 @@ int main(int argc, const char *argv[])
        }
 
        DEBUG(DEBUG_NOTICE,("Starting CTDB daemon\n"));
+
        gettimeofday(&ctdb->ctdbd_start_time, NULL);
        gettimeofday(&ctdb->last_recovery_started, NULL);
        gettimeofday(&ctdb->last_recovery_finished, NULL);
@@ -205,6 +207,7 @@ int main(int argc, const char *argv[])
 
        ctdb_tunables_set_defaults(ctdb);
 
+       ctdb->tunable.disable_ip_failover = options.no_publicipcheck;
 
        ret = ctdb_set_recovery_lock_file(ctdb, options.recovery_lock_file);
        if (ret == -1) {
@@ -297,14 +300,6 @@ int main(int argc, const char *argv[])
                }
        }
 
-       if (options.public_address_list) {
-               ret = ctdb_set_public_addresses(ctdb, options.public_address_list);
-               if (ret == -1) {
-                       DEBUG(DEBUG_ALERT,("Unable to setup public address list\n"));
-                       exit(1);
-               }
-       }
-
        ret = ctdb_set_event_script_dir(ctdb, options.event_script_dir);
        if (ret == -1) {
                DEBUG(DEBUG_ALERT,("Unable to setup event script directory\n"));
@@ -321,8 +316,6 @@ int main(int argc, const char *argv[])
 
        ctdb->valgrinding = options.valgrinding;
 
-       ctdb->do_checkpublicip = !options.no_publicipcheck;
-
        if (options.max_persistent_check_errors < 0) {
                ctdb->max_persistent_check_errors = 0xFFFFFFFFFFFFFFFFLL;
        } else {
@@ -336,5 +329,5 @@ int main(int argc, const char *argv[])
        }
 
        /* start the protocol running (as a child) */
-       return ctdb_start_daemon(ctdb, interactive?False:True, options.use_syslog);
+       return ctdb_start_daemon(ctdb, interactive?False:True, options.use_syslog, options.public_address_list);
 }