Add server.respawn_on_signal config option

This commit is contained in:
Andrew Bettison 2012-07-25 17:01:47 +09:30
parent ba69ae616f
commit c545061b50
2 changed files with 10 additions and 5 deletions

View File

@ -35,6 +35,7 @@ char *exec_args[EXEC_NARGS + 1];
int exec_argc = 0;
int serverMode=0;
int serverRespawnOnSignal = 0;
int servalShutdown = 0;
static int server_getpid = 0;
@ -175,13 +176,16 @@ int server(char *backing_file)
}
serverMode = 1;
serverRespawnOnSignal = confValueGetBoolean("server.respawn_on_signal", 0);
/* Catch sigsegv and other crash signals so that we can relaunch ourselves */
signal(SIGSEGV, signal_handler);
signal(SIGFPE, signal_handler);
signal(SIGILL, signal_handler);
signal(SIGBUS, signal_handler);
signal(SIGABRT, signal_handler);
if (serverRespawnOnSignal) {
signal(SIGSEGV, signal_handler);
signal(SIGFPE, signal_handler);
signal(SIGILL, signal_handler);
signal(SIGBUS, signal_handler);
signal(SIGABRT, signal_handler);
}
/* Catch SIGHUP etc so that we can respond to requests to do things */
signal(SIGHUP, signal_handler);
signal(SIGINT, signal_handler);

View File

@ -44,6 +44,7 @@ configure_servald_server() {
executeOk_servald config set debug.rhizome on
executeOk_servald config set debug.rhizometx on
executeOk_servald config set debug.rhizomerx on
executeOk_servald config set server.respawn_on_signal off
executeOk_servald config set mdp.wifi.tick_ms 100
executeOk_servald config set mdp.selfannounce.ticks_per_full_address 1
executeOk_servald config set rhizome.fetch_interval_ms 100