public function restart() { $length = strlen($this->getName()); foreach ($this->supervisor->getAllProcessInfo() as $i) { if ($this->getName() == substr($i['name'], 0, $length)) { if ('STOPPED' == $i['statename']) { $this->supervisor->startProcess($this->getGroup(), $i['name']); sleep(1); // sleep while process starts } } } return true; }