original_string: protected static function daemonize()
      {
          if (!static::$daemonize || static::$_OS !== OS_TYPE_LINUX) {
              return;
          }
          umask(0);
          $pid = pcntl_fork();
          if (-1 === $pid) {
              throw new Exception('fork fail');
          } elseif ($pid > 0) {
              exit(0);
          }
          if (-1 === posix_setsid()) {
              throw new Exception("setsid fail");
          }
          // Fork again avoid SVR4 system regain the control of terminal.
          $pid = pcntl_fork();
          if (-1 === $pid) {
              throw new Exception("fork fail");
          } elseif (0 !== $pid) {
              exit(0);
          }
      }
code: protected static function daemonize()
      {
          if (!static::$daemonize || static::$_OS !== OS_TYPE_LINUX) {
              return;
          }
          umask(0);
          $pid = pcntl_fork();
          if (-1 === $pid) {
              throw new Exception('fork fail');
          } elseif ($pid > 0) {
              exit(0);
          }
          if (-1 === posix_setsid()) {
              throw new Exception("setsid fail");
          }
          // Fork again avoid SVR4 system regain the control of terminal.
          $pid = pcntl_fork();
          if (-1 === $pid) {
              throw new Exception("fork fail");
          } elseif (0 !== $pid) {
              exit(0);
          }
      }
code_tokens: protected static function daemonize ( ) { if ( ! static :: $ daemonize || static :: $ _OS !== OS_TYPE_LINUX ) { return ; } umask ( 0 ) ; $ pid = pcntl_fork ( ) ; if ( - 1 === $ pid ) { throw new Exception ( 'fork fail' ) ; } elseif ( $ pid > 0 ) { exit ( 0 ) ; } if ( - 1 === posix_setsid ( ) ) { throw new Exception ( "setsid fail" ) ; } // Fork again avoid SVR4 system regain the control of terminal. $ pid = pcntl_fork ( ) ; if ( - 1 === $ pid ) { throw new Exception ( "fork fail" ) ; } elseif ( 0 !== $ pid ) { exit ( 0 ) ; } }
docstring: Run as deamon mode.
  
  @throws Exception
docstring_tokens: Run as deamon mode .