Пример #1
0
 /**
  * Start script.
  * @return void
  */
 public static function start()
 {
     if (Daemon_Bootstrap::$pid && posix_kill(Daemon_Bootstrap::$pid, SIGTTIN)) {
         Daemon::log('[START] phpDaemon with pid-file \'' . Daemon::$config->pidfile->value . '\' is running already (PID ' . Daemon_Bootstrap::$pid . ')');
         exit;
     }
     Daemon::init();
     $pid = Daemon::spawnMaster();
     file_put_contents(Daemon::$config->pidfile->value, $pid);
 }