TODO: server: add --panic-action and CTDB_PANIC_ACTION option for backtrace support
[metze/ctdb/wip.git] / server / ctdbd.c
index b90dbcdf1e41683d3f61e30bdb9bf0bf26689a45..4654d2dc418626a1bccd152a4c6e66a58b845c5c 100644 (file)
@@ -42,6 +42,7 @@ static struct {
        const char *public_interface;
        const char *single_public_ip;
        const char *node_ip;
+       const char *panic_action;
        int         valgrinding;
        int         use_syslog;
        int         start_as_disabled;
@@ -132,6 +133,9 @@ int main(int argc, const char *argv[])
                { "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" },
+               { "panic-action", 0, POPT_ARG_STRING,
+                 &options.panic_action, 0,
+                 "set the panic action (default none)", 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 },
@@ -176,6 +180,7 @@ int main(int argc, const char *argv[])
 
        ctdb_block_signal(SIGPIPE);
        fault_setup("ctdbd");
+       panic_action = options.panic_action;
 
        ev = event_context_init(NULL);
        tevent_loop_allow_nesting(ev);