public function run($followingCommand = '')
    {
        $result = $this->execute('status', false)->getOutput();
        if (strpos($result, 'sock no such file') || strpos($result, 'refused connection')) {
            $command = sprintf(
                'supervisord%1$s%2$s%3$s',
                $this->configurationParameter,
                $this->identifierParameter,
                $followingCommand
            );
            $this->logger->debug('Executing: ' . $command);
            $p = new Process($command);
            $p->setWorkingDirectory($this->applicationDirectory);
            if (!$this->waitForSupervisord) {
                $p->start();
            } else {
                $p->run();
                if ($p->getExitCode() !== 0) {
                    $this->logger->critical(sprintf('supervisord returns code: %s', $p->getExitCodeText()));
                    throw new ProcessException($p);
                }
                $this->logger->debug('supervisord output: '. $p->getOutput());
            }
        }
    }
public function run($followingCommand = '')
    {
        $result = $this->execute('status', false)->getOutput();
        if (strpos($result, 'sock no such file') || strpos($result, 'refused connection')) {
            $command = sprintf(
                'supervisord%1$s%2$s%3$s',
                $this->configurationParameter,
                $this->identifierParameter,
                $followingCommand
            );
            $this->logger->debug('Executing: ' . $command);
            $p = new Process($command);
            $p->setWorkingDirectory($this->applicationDirectory);
            if (!$this->waitForSupervisord) {
                $p->start();
            } else {
                $p->run();
                if ($p->getExitCode() !== 0) {
                    $this->logger->critical(sprintf('supervisord returns code: %s', $p->getExitCodeText()));
                    throw new ProcessException($p);
                }
                $this->logger->debug('supervisord output: '. $p->getOutput());
            }
        }
    }
public function run ( $ followingCommand = '' ) { $ result = $ this -> execute ( 'status' , false ) -> getOutput ( ) ; if ( strpos ( $ result , 'sock no such file' ) || strpos ( $ result , 'refused connection' ) ) { $ command = sprintf ( 'supervisord%1$s%2$s%3$s' , $ this -> configurationParameter , $ this -> identifierParameter , $ followingCommand ) ; $ this -> logger -> debug ( 'Executing: ' . $ command ) ; $ p = new Process ( $ command ) ; $ p -> setWorkingDirectory ( $ this -> applicationDirectory ) ; if ( ! $ this -> waitForSupervisord ) { $ p -> start ( ) ; } else { $ p -> run ( ) ; if ( $ p -> getExitCode ( ) !== 0 ) { $ this -> logger -> critical ( sprintf ( 'supervisord returns code: %s' , $ p -> getExitCodeText ( ) ) ) ; throw new ProcessException ( $ p ) ; } $ this -> logger -> debug ( 'supervisord output: ' . $ p -> getOutput ( ) ) ; } } }
Start supervisord if not already running

@param $followingCommand string command to execute after supervisord was started
Start supervisord if not already running