mirror of https://github.com/dnomd343/kms-server
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
45 lines
1.0 KiB
2 years ago
|
<?php
|
||
|
|
||
2 years ago
|
$version = 'dev';
|
||
|
|
||
|
require_once './src/Daemon.php';
|
||
|
require_once './src/Logger.php';
|
||
|
require_once './src/Process.php';
|
||
2 years ago
|
|
||
|
$nginx = array(
|
||
2 years ago
|
'name' => 'nginx',
|
||
2 years ago
|
'command' => ['/usr/sbin/nginx'],
|
||
|
'pidFile' => '/run/nginx/nginx.pid',
|
||
|
);
|
||
|
|
||
2 years ago
|
$phpFpm = array(
|
||
|
'name' => 'php-fpm8',
|
||
|
'command' => ['/usr/sbin/php-fpm8'],
|
||
|
'pidFile' => '/run/php-fpm8.pid',
|
||
|
);
|
||
|
|
||
|
$vlmcsd = array(
|
||
|
'name' => 'vlmcsd',
|
||
|
'command' => ['/usr/bin/vlmcsd', '-e', '-p', '/run/vlmcsd.pid'],
|
||
|
'pidFile' => '/run/vlmcsd.pid',
|
||
|
);
|
||
|
|
||
|
declare(ticks = 1);
|
||
|
pcntl_signal(SIGCHLD, 'subExit'); // receive SIGCHLD signal
|
||
2 years ago
|
logging::info('Loading kms-server (' . $version . ')');
|
||
2 years ago
|
|
||
2 years ago
|
new Process($nginx['command']);
|
||
2 years ago
|
logging::info('Start nginx server...OK');
|
||
2 years ago
|
new Process($phpFpm['command']);
|
||
2 years ago
|
logging::info('Start php-fpm server...OK');
|
||
2 years ago
|
new Process($vlmcsd['command']);
|
||
2 years ago
|
logging::info('Start vlmcsd server...OK');
|
||
|
|
||
|
logging::info('Enter the daemon process');
|
||
2 years ago
|
while (true) {
|
||
2 years ago
|
msSleep(5000); // sleep 5s
|
||
2 years ago
|
daemon($nginx);
|
||
|
daemon($phpFpm);
|
||
|
daemon($vlmcsd);
|
||
2 years ago
|
}
|