add support of process signals

This commit is contained in:
Beu
2023-12-01 19:05:24 +01:00
parent 251988b19b
commit 93423e36af
2 changed files with 8 additions and 0 deletions

View File

@ -652,6 +652,11 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
Logger::log('Starting ManiaControl v' . self::VERSION . '!');
try {
// Manage SIGTERM signal
pcntl_signal(SIGTERM, function() {
$this->quit("Stop signal received from the OS.", false);
});
// Connect to server
$this->connect();