No functional changes.
This is staging for a change that makes ctdbd fork when test mode is
enabled but interactive is not set.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
void daemon_tunnel_handler(uint64_t tunnel_id, TDB_DATA data,
void *private_data);
-int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork);
+int ctdb_start_daemon(struct ctdb_context *ctdb,
+ bool interactive,
+ bool test_mode_enabled);
struct ctdb_req_header *_ctdb_transport_allocate(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
/*
start the protocol going as a daemon
*/
-int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork)
+int ctdb_start_daemon(struct ctdb_context *ctdb,
+ bool interactive,
+ bool test_mode_enabled)
{
int res, ret = -1;
struct tevent_fd *fde;
+ bool do_fork = !(interactive || test_mode_enabled);
become_daemon(do_fork, !do_fork, false);
fast_start = true;
}
- /* Don't fork when running in test mode */
- interactive = interactive || test_mode != NULL;
-
/* start the protocol running (as a child) */
- return ctdb_start_daemon(ctdb, !interactive);
+ return ctdb_start_daemon(ctdb, interactive, test_mode != NULL);
fail:
talloc_free(ctdb);