2 Commits

Author SHA1 Message Date
86d2b8c1cf Added event for SIGTERM and SIGINT 2021-11-29 15:34:19 +01:00
7ff6556d51 Merge branch 'f_userHelper' into dev 2021-11-29 15:12:39 +01:00

View File

@@ -117,5 +117,14 @@ if(errorMsg){
exit(0); exit(0);
}); });
// Handle stop-signals for graceful shutdown
function shutdownReq() {
logger.info("Shutdown request received..");
logger.debug("Stopping subprocess tcpdump, then exiting myself..");
proc.kill(); // Kill process (send SIGTERM), then upper event-handler will stop self
}
process.on('SIGTERM', shutdownReq);
process.on('SIGINT', shutdownReq);
logger.info("Startup complete"); logger.info("Startup complete");
})(); })();