diff --git a/lib/Fresque.php b/lib/Fresque.php index 06b5558..6d594e4 100644 --- a/lib/Fresque.php +++ b/lib/Fresque.php @@ -1448,7 +1448,7 @@ protected function exec($cmd) protected function kill($signal, $pid) { $output = array(); - $message = exec(sprintf('/bin/kill -%s %s 2>&1', $signal, $pid), $output, $code); + $message = exec(sprintf(($this->runtime['Default']['user'] !== $this->getProcessOwner() ? ('sudo -u '. escapeshellarg($this->runtime['Default']['user'])) . ' ' : "") . '/bin/kill -%s %s 2>&1', $signal, $pid), $output, $code); return array('code' => $code, 'message' => $message); }