diff --git a/lib/factorio/server.js b/lib/factorio/server.js index 8d031f5d..70f93d55 100644 --- a/lib/factorio/server.js +++ b/lib/factorio/server.js @@ -651,7 +651,8 @@ class FactorioServer extends events.EventEmitter { // There appears to be an race condition where sending SIGTERM // immediatly before the RCON interface comes online causes the // Factorio server to hang. It's also possible the server doesn't - // stop if it's stuck with an infinite lua code loop. + // stop if it's stuck with an infinite lua code loop. In either + // case there's no recovering from it. if (process.platform !== "win32") { let hanged = true; function setAlive(output) { hanged = false; } @@ -659,8 +660,8 @@ class FactorioServer extends events.EventEmitter { let timeoutId = setTimeout(() => { if (hanged) { - console.error("Factorio appears to have hanged, sending second SIGTERM"); - this._server.kill(); + console.error("Factorio appears to have hanged, sending SIGKILL"); + this._server.kill('SIGKILL'); } }, 5000);