*/
#include "includes.h"
-#include "lib/events/events.h"
+#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "system/time.h"
const char *public_interface;
const char *single_public_ip;
const char *node_ip;
- int no_setsched;
+ int valgrinding;
int use_syslog;
int start_as_disabled;
int start_as_stopped;
};
int script_log_level;
+bool fast_start;
/*
called by the transport layer when a packet comes in
{ "dbdir-persistent", 0, POPT_ARG_STRING, &options.db_dir_persistent, 0, "directory for persistent tdb files", NULL },
{ "dbdir-state", 0, POPT_ARG_STRING, &options.db_dir_state, 0, "directory for internal state tdb files", NULL },
{ "reclock", 0, POPT_ARG_STRING, &options.recovery_lock_file, 0, "location of recovery lock file", "filename" },
- { "nosetsched", 0, POPT_ARG_NONE, &options.no_setsched, 0, "disable setscheduler SCHED_FIFO call", NULL },
+ { "valgrinding", 0, POPT_ARG_NONE, &options.valgrinding, 0, "make valgrind more effective", NULL },
{ "syslog", 0, POPT_ARG_NONE, &options.use_syslog, 0, "log messages to syslog", NULL },
{ "start-as-disabled", 0, POPT_ARG_NONE, &options.start_as_disabled, 0, "Node starts in disabled state", NULL },
{ "start-as-stopped", 0, POPT_ARG_NONE, &options.start_as_stopped, 0, "Node starts in stopped state", NULL },
{ "no-recmaster", 0, POPT_ARG_NONE, &options.no_recmaster, 0, "disable recmaster role on this node", NULL },
{ "lvs", 0, POPT_ARG_NONE, &options.lvs, 0, "lvs is enabled on this node", NULL },
{ "script-log-level", 0, POPT_ARG_INT, &options.script_log_level, DEBUG_ERR, "log level of event script output", NULL },
- { "nopublicipcheck", 0, POPT_ARG_NONE, &options.no_publicipcheck, 0, "dont check we have/dont have the correct public ip addresses", NULL },
+ { "nopublicipcheck", 0, POPT_ARG_NONE, &options.no_publicipcheck, 0, "don't check we have/don't have the correct public ip addresses", NULL },
{ "max-persistent-check-errors", 0, POPT_ARG_INT,
&options.max_persistent_check_errors, 0,
"max allowed persistent check errors (default 0)", NULL },
+ { "log-ringbuf-size", 0, POPT_ARG_INT, &log_ringbuf_size, DEBUG_ERR, "Number of log messages we can store in the memory ringbuffer", NULL },
+ { "sloppy-start", 0, POPT_ARG_NONE, &fast_start, 0, "Do not perform full recovery on start", NULL },
POPT_TABLEEND
};
int opt, ret;
talloc_enable_null_tracking();
ctdb_block_signal(SIGPIPE);
+ fault_setup("ctdbd");
ev = event_context_init(NULL);
+ tevent_loop_allow_nesting(ev);
ctdb = ctdb_cmdline_init(ev);
}
if (options.single_public_ip) {
- struct ctdb_vnn *svnn;
-
if (options.public_interface == NULL) {
DEBUG(DEBUG_ALERT,("--single_public_ip used but --public_interface is not specified. You must specify the public interface when using single public ip. Exiting\n"));
exit(10);
}
- svnn = talloc_zero(ctdb, struct ctdb_vnn);
- CTDB_NO_MEMORY(ctdb, svnn);
-
- ctdb->single_ip_vnn = svnn;
- svnn->iface = talloc_strdup(svnn, options.public_interface);
- CTDB_NO_MEMORY(ctdb, svnn->iface);
-
- if (parse_ip(options.single_public_ip,
- svnn->iface,
- 0,
- &svnn->public_address) == 0) {
+ ret = ctdb_set_single_public_ip(ctdb, options.public_interface,
+ options.single_public_ip);
+ if (ret != 0) {
DEBUG(DEBUG_ALERT,("Invalid --single-public-ip argument : %s . This is not a valid ip address. Exiting.\n", options.single_public_ip));
exit(10);
}
}
}
- ctdb->do_setsched = !options.no_setsched;
+ ctdb->valgrinding = options.valgrinding;
ctdb->do_checkpublicip = !options.no_publicipcheck;