mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
Handle SIGHUP gracefully
Invoke shutdown instead of exiting immediately when SIGHUP is received, and do the same on both slave and master for signals received.
This commit is contained in:
1 parent
4ca092f351
commit
9660fa0801
2 files changed
+7
-7
No files matched your search
@@ -1633,7 +1633,7 @@ async function startSlave() {
|
||||
process.on("SIGTERM", () => {
|
||||
if (secondSigterm) {
|
||||
setBlocking(true);
|
||||
logger.fatal("Caught second termination signal, terminating immediately");
|
||||
logger.fatal("Caught second termination, terminating immediately");
|
||||
// eslint-disable-next-line no-process-exit
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -1642,6 +1642,10 @@ async function startSlave() {
|
||||
logger.info("Caught termination signal, shutting down");
|
||||
slave.shutdown();
|
||||
});
|
||||
process.on("SIGHUP", () => {
|
||||
logger.info("Terminal closed, shutting down");
|
||||
slave.shutdown();
|
||||
});
|
||||
|
||||
slaveConnector.once("connect", () => {
|
||||
logger.add(new libLoggingUtils.LinkTransport({ link: slave }));
|
||||
|
||||
Reference in new issue
Block a user