#include <signal.h>
int newserv_shutdown_pending;
+int newserv_sigusr1_pending;
void initseed();
void init_logfile();
void siginthandler(int sig);
+void sigusr1handler(int sig);
int main(int argc, char **argv) {
initseed();
/* Loading the modules will bring in the bulk of the code */
initmodules();
signal(SIGINT, siginthandler);
+ signal(SIGUSR1, sigusr1handler);
/* Main loop */
for(;;) {
newserv_shutdown();
break;
}
+
+ if (newserv_sigusr1_pending) {
+ triggerhook(HOOK_CORE_SIGUSR1, NULL);
+ newserv_sigusr1_pending=0;
+ }
}
nsexit();
void siginthandler(int sig) {
newserv_shutdown_pending = 1;
}
+
+void sigusr1handler(int sig) {
+ newserv_sigusr1_pending = 1;
+}