From e782b61732bd199ff6803c7fa47ee8efb6f6baf4 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Mon, 21 Oct 2013 19:52:01 +1100 Subject: ctdbd: Pass the public address file location in ctdb context No need to pass it as an extra argument to ctdb_start_daemon. Also ensure options.public_address_list gets a nice static default. Signed-off-by: Martin Schwenke (This used to be ctdb commit a3d63a9db89d08bb284b3b3a6db773422f21b477) --- ctdb/include/ctdb_private.h | 3 +-- ctdb/server/ctdb_daemon.c | 5 ++--- ctdb/server/ctdbd.c | 4 +++- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'ctdb') diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 3430f9cd01d..f261867b3a3 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -769,8 +769,7 @@ struct ctdb_call_state *ctdb_call_local_send(struct ctdb_db_context *ctdb_db, int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, - bool use_syslog, - const char *public_address_list); + bool use_syslog); struct ctdb_call_state *ctdbd_call_send(struct ctdb_db_context *ctdb_db, struct ctdb_call *call); int ctdbd_call_recv(struct ctdb_call_state *state, struct ctdb_call *call); diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index 92dc8de59d0..cbe6b23ce0e 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -1145,7 +1145,7 @@ static void ctdb_create_pidfile(pid_t pid) /* start the protocol going as a daemon */ -int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, bool use_syslog, const char *public_address_list) +int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, bool use_syslog) { int res, ret = -1; struct fd_event *fde; @@ -1261,8 +1261,7 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, bool use_syslog, initialise_node_flags(ctdb); - if (public_address_list) { - ctdb->public_addresses_file = public_address_list; + if (ctdb->public_addresses_file) { ret = ctdb_set_public_addresses(ctdb, true); if (ret == -1) { DEBUG(DEBUG_ALERT,("Unable to setup public address list\n")); diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c index f19b48ff2ed..f3cb9d3e95f 100644 --- a/ctdb/server/ctdbd.c +++ b/ctdb/server/ctdbd.c @@ -53,6 +53,7 @@ static struct { int max_persistent_check_errors; } options = { .nlist = NULL, + .public_address_list = NULL, .transport = "tcp", .event_script_dir = NULL, .logfile = LOGDIR "/log.ctdb", @@ -322,6 +323,7 @@ int main(int argc, const char *argv[]) ctdb->do_setsched = 1; } + ctdb->public_addresses_file = options.public_address_list; ctdb->do_checkpublicip = !options.no_publicipcheck; if (options.max_persistent_check_errors < 0) { @@ -331,5 +333,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, options.public_address_list); + return ctdb_start_daemon(ctdb, interactive?false:true, options.use_syslog); } -- cgit