fr_event_loop_exit(el, 1);
} else {
INFO("Signalled to terminate");
- exec_trigger(NULL, NULL, "server.signal.term", true);
fr_event_loop_exit(el, 2);
}
INFO("Exiting normally");
}
- exec_trigger(NULL, NULL, "server.stop", false);
-
/*
* Ignore the TERM signal: we're
* about to die.
signal(SIGTERM, SIG_IGN);
/*
+ * Fire signal and stop triggers after ignoring SIGTERM, so handlers are
+ * not killed with the rest of the process group, below.
+ */
+ if (status == 2)
+ exec_trigger(NULL, NULL, "server.signal.term", true);
+ exec_trigger(NULL, NULL, "server.stop", false);
+
+ /*
* Send a TERM signal to all
* associated processes
* (including us, which gets