mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Add proper exit codes
This commit is contained in:
parent
bf4de012da
commit
50c127fd9a
@ -57,9 +57,13 @@ namespace Jellyfin.Server
|
|||||||
// Intercept Ctrl+C and Ctrl+Break
|
// Intercept Ctrl+C and Ctrl+Break
|
||||||
Console.CancelKeyPress += (sender, e) =>
|
Console.CancelKeyPress += (sender, e) =>
|
||||||
{
|
{
|
||||||
|
if (_tokenSource.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
return; // Already shutting down
|
||||||
|
}
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
_logger.LogInformation("Ctrl+C, shutting down");
|
_logger.LogInformation("Ctrl+C, shutting down");
|
||||||
Environment.ExitCode = 2;
|
Environment.ExitCode = 128 + 2;
|
||||||
Shutdown();
|
Shutdown();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -71,6 +75,7 @@ namespace Jellyfin.Server
|
|||||||
return; // Already shutting down
|
return; // Already shutting down
|
||||||
}
|
}
|
||||||
_logger.LogInformation("Received a SIGTERM signal, shutting down");
|
_logger.LogInformation("Received a SIGTERM signal, shutting down");
|
||||||
|
Environment.ExitCode = 128 + 15;
|
||||||
Shutdown();
|
Shutdown();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user