The Free Software Media System - Server Backend & API
Add proper exit codes
Bond_00950c127fd9af0
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.csindex d370cdc691..acbe5c7144 100644--- a/Jellyfin.Server/Program.cs+++ b/Jellyfin.Server/Program.cs@@ -57,9 +57,13 @@ namespace Jellyfin.Server// Intercept Ctrl+C and Ctrl+BreakConsole.CancelKeyPress += (sender, e) =>{+ if (_tokenSource.IsCancellationRequested)+ {+ return; // Already shutting down+ }e.Cancel = true;_logger.LogInformation("Ctrl+C, shutting down");- Environment.ExitCode = 2;+ Environment.ExitCode = 128 + 2;Shutdown();};@@ -71,6 +75,7 @@ namespace Jellyfin.Serverreturn; // Already shutting down}_logger.LogInformation("Received a SIGTERM signal, shutting down");+ Environment.ExitCode = 128 + 15;Shutdown();};