From 170cba23fae2ef091f39b7c71e0baf086a38efb5 Mon Sep 17 00:00:00 2001 From: Dan Hunsaker Date: Mon, 10 Dec 2018 19:00:23 -0700 Subject: [PATCH] Apply old PR 293 Closes chrisboulton/php-resque#293 --- lib/Resque/Worker.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Resque/Worker.php b/lib/Resque/Worker.php index 3add46e..946a215 100644 --- a/lib/Resque/Worker.php +++ b/lib/Resque/Worker.php @@ -427,7 +427,7 @@ public function killChild() } $this->logger->log(Psr\Log\LogLevel::INFO, 'Killing child at {child}', array('child' => $this->child)); - if(exec('ps -o pid,state -p ' . $this->child, $output, $returnCode) && $returnCode != 1) { + if(exec('ps -o pid,s -p ' . $this->child, $output, $returnCode) && $returnCode != 1) { $this->logger->log(Psr\Log\LogLevel::DEBUG, 'Child {child} found, killing.', array('child' => $this->child)); posix_kill($this->child, SIGKILL); $this->child = null; @@ -471,7 +471,7 @@ public function pruneDeadWorkers() public function workerPids() { $pids = array(); - exec('ps -A -o pid,command | grep [r]esque', $cmdOutput); + exec('ps -A -o pid,args | grep [r]esque', $cmdOutput); foreach($cmdOutput as $line) { list($pids[],) = explode(' ', trim($line), 2); }