public function execute($cmd, $failOnError = true)
    {
        $command = $this->createSupervisorControlCommand($cmd);
        $this->logger->debug('Executing: ' . $command);
        $p = new Process($command);
        $p->setWorkingDirectory($this->applicationDirectory);
        $p->run();
        if ($failOnError) {
            if ($p->getExitCode() !== 0) {
                $this->logger->critical(sprintf('supervisorctl returns code: %s', $p->getExitCodeText()));
            }
            $this->logger->debug('supervisorctl output: '. $p->getOutput());

            if ($p->getExitCode() !== 0) {
                throw new ProcessException($p);
            }
        }

        return $p;
    }