Merge pull request #359 from AxtonF/HandleSIGTERM

Add handling of SIGTERM
This commit is contained in:
Xiphoseer 2022-02-05 15:38:49 +01:00 committed by GitHub
commit b8c1f7629e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -63,6 +63,7 @@ int main(int argc, char** argv) {
//Triggers the shutdown sequence at application exit
std::atexit(ShutdownSequence);
signal(SIGINT, [](int) { ShutdownSequence(); });
signal(SIGTERM, [](int) { ShutdownSequence(); });
//Create all the objects we need to run our service:
Game::logger = SetupLogger();

View File

@ -100,10 +100,8 @@ int main(int argc, char** argv) {
// Triggers the shutdown sequence at application exit
std::atexit(WorldShutdownSequence);
signal(SIGINT, [](int)
{
WorldShutdownSequence();
});
signal(SIGINT, [](int){ WorldShutdownSequence(); });
signal(SIGTERM, [](int){ WorldShutdownSequence(); });
int zoneID = 1000;
int cloneID = 0;