aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2019-01-13 01:05:25 +0100
committerBond_009 <bond.009@outlook.com>2019-01-13 01:05:25 +0100
commit50c127fd9af0078556bdf74b6a96f0d5e0478d5c (patch)
treee63df428768f3baa9b486d66ecb3d6426c08d568
parentbf4de012da46a7ee875c5439c4a0f1355d8978d2 (diff)
Add proper exit codes
-rw-r--r--Jellyfin.Server/Program.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index d370cdc69..acbe5c714 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -57,9 +57,13 @@ namespace Jellyfin.Server
// Intercept Ctrl+C and Ctrl+Break
Console.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.Server
return; // Already shutting down
}
_logger.LogInformation("Received a SIGTERM signal, shutting down");
+ Environment.ExitCode = 128 + 15;
Shutdown();
};