Merge pull request #519 from mc-server/sigterm

Graceful shutdown on SIGTERM
This commit is contained in:
Mattes D
2014-01-07 23:36:01 -08:00
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -50,6 +50,11 @@ void NonCtrlHandler(int a_Signal)
LOGWARN("Segmentation fault; MCServer has crashed :(");
exit(EXIT_FAILURE);
}
case SIGTERM:
{
std::signal(SIGTERM, SIG_IGN); // Server is shutting down, wait for it...
break;
}
default: break;
}
}