static void
signal_handling_playback(struct worker* wrk)
{
- if(sig_record_quit)
- worker_sighandler(SIGTERM, wrk);
if(sig_record_reload)
worker_sighandler(SIGHUP, wrk);
+ if(sig_record_quit)
+ worker_sighandler(SIGTERM, wrk);
sig_record_quit = 0;
sig_record_reload = 0;
}
/* we exited! a signal happened! Stop other threads */
daemon_stop_others(daemon);
- if(daemon->workers[0]->need_to_restart)
- daemon->need_to_exit = 0;
- else daemon->need_to_exit = 1;
+ daemon->need_to_exit = daemon->workers[0]->need_to_exit;
}
void
switch(sig) {
case SIGHUP:
verbose(VERB_DETAIL, "caught signal SIGHUP");
- worker->need_to_restart = 1;
comm_base_exit(worker->base);
break;
case SIGINT:
verbose(VERB_DETAIL, "caught signal SIGINT");
- worker->need_to_restart = 0;
+ worker->need_to_exit = 1;
comm_base_exit(worker->base);
break;
case SIGQUIT:
verbose(VERB_DETAIL, "caught signal SIGQUIT");
- worker->need_to_restart = 0;
+ worker->need_to_exit = 1;
comm_base_exit(worker->base);
break;
case SIGTERM:
verbose(VERB_DETAIL, "caught signal SIGTERM");
- worker->need_to_restart = 0;
+ worker->need_to_exit = 1;
comm_base_exit(worker->base);
break;
default:
{
unsigned int seed;
int startport;
- worker->need_to_restart = 0;
+ worker->need_to_exit = 0;
worker->base = comm_base_create();
if(!worker->base) {
log_err("could not create event handling base");
/** random() table for this worker. */
struct ub_randstate* rndstate;
- /** do we need to restart (instead of exit) ? */
- int need_to_restart;
+ /** do we need to restart or quit (on signal) */
+ int need_to_exit;
/** allocation cache for this thread */
struct alloc_cache alloc;
/** per thread statistics */
+12 November 2007: Wouter
+ - fixup signal handling where SIGTERM could be ignored if a SIGHUP
+ arrives later on.
+
9 November 2007: Wouter
- took ldns snapshot in repo.
- default config file is /etc/unbound/unbound.conf.