Ejemplo n.º 1
0
static void __config_reload(void (*notify)(int))
{
	struct _triton_thread_t *t;
	int r;

	log_debug2("config_reload: enter\n");
	r = conf_reload(NULL);
	notify(r);

	spin_lock(&threads_lock);
	need_config_reload = 0;
	list_for_each_entry(t, &threads, entry)
		triton_thread_wakeup(t);
	spin_unlock(&threads_lock);
	log_debug2("config_reload: exit\n");
}
Ejemplo n.º 2
0
Archivo: main.c Proyecto: JoeDog/fido
void 
sighandler(int sig)
{
  LOG L = new_logger("syslog");

  switch(sig) {
    case SIGHUP:
      logger(L, "Received SIGHUP signal; reloading config.");
      conf_reload(C);
      break;
    case SIGINT:
    case SIGTERM:
      errno = 0;
      logger(L, "Shutting down [TERM].");
      VERBOSE(is_verbose(C), "Stopping %s[pid=%d]", program_name, getpid());
      exit(EXIT_SUCCESS);
      break;
    default:
      break;
  }
}