From e5de6de30d489f1a88b03146b7bfa4c4e4ce7f76 Mon Sep 17 00:00:00 2001 From: Alexis Date: Wed, 15 Sep 2021 09:46:02 +0930 Subject: [PATCH] fix: log on CTRL+C exit --- app/cli.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/cli.ts b/app/cli.ts index bdff9f8e5..68ac19291 100644 --- a/app/cli.ts +++ b/app/cli.ts @@ -110,7 +110,7 @@ const commands = { if (mainOptions.debug || process.env._DAEMONIZE_PROCESS) { // Log when the API exits addExitCallback((signal, exitCode, error) => { - if (exitCode === 0 || signal === 'SIGTERM') { + if (exitCode === 0 || exitCode === 130 || signal === 'SIGTERM') { logToSyslog('👋 Farewell. UNRAID API shutting down!'); return; } @@ -123,6 +123,7 @@ const commands = { // Log when we crash if (exitCode) { logToSyslog(`⚠️ UNRAID API crashed with exit code ${exitCode}`); + return; } logToSyslog('🛑 UNRAID API crashed without an exit code?');