1
0
Fork 0

Graceful shutdown on SIGTERM

This commit is contained in:
Tiger Wang 2014-01-07 21:23:26 +00:00
parent 524aecc106
commit f578dbfc54
1 changed files with 5 additions and 0 deletions

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;
}
}