|
@ -1,8 +1,10 @@ |
|
|
<?php |
|
|
<?php |
|
|
|
|
|
|
|
|
require_once 'Daemon.php'; |
|
|
$version = 'dev'; |
|
|
require_once 'Logger.php'; |
|
|
|
|
|
require_once 'Process.php'; |
|
|
require_once './src/Daemon.php'; |
|
|
|
|
|
require_once './src/Logger.php'; |
|
|
|
|
|
require_once './src/Process.php'; |
|
|
|
|
|
|
|
|
$nginx = array( |
|
|
$nginx = array( |
|
|
'name' => 'nginx', |
|
|
'name' => 'nginx', |
|
@ -24,12 +26,18 @@ $vlmcsd = array( |
|
|
|
|
|
|
|
|
declare(ticks = 1); |
|
|
declare(ticks = 1); |
|
|
pcntl_signal(SIGCHLD, 'subExit'); // receive SIGCHLD signal |
|
|
pcntl_signal(SIGCHLD, 'subExit'); // receive SIGCHLD signal |
|
|
|
|
|
logging::info('Loading kms-server (' . $version . ')'); |
|
|
|
|
|
|
|
|
new Process($nginx['command']); |
|
|
new Process($nginx['command']); |
|
|
|
|
|
logging::info('Start nginx server...OK'); |
|
|
new Process($phpFpm['command']); |
|
|
new Process($phpFpm['command']); |
|
|
|
|
|
logging::info('Start php-fpm server...OK'); |
|
|
new Process($vlmcsd['command']); |
|
|
new Process($vlmcsd['command']); |
|
|
|
|
|
logging::info('Start vlmcsd server...OK'); |
|
|
|
|
|
|
|
|
|
|
|
logging::info('Enter the daemon process'); |
|
|
while (true) { |
|
|
while (true) { |
|
|
msSleep(3000); // sleep 3s |
|
|
msSleep(5000); // sleep 5s |
|
|
daemon($nginx); |
|
|
daemon($nginx); |
|
|
daemon($phpFpm); |
|
|
daemon($phpFpm); |
|
|
daemon($vlmcsd); |
|
|
daemon($vlmcsd); |