We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5d58254 + 7f195aa commit 4da1201Copy full SHA for 4da1201
Services/RabbitMqSupervisor.php
@@ -197,13 +197,19 @@ public function wait()
197
*/
198
private function isProcessRunning($pid) {
199
$state = array();
200
- exec(sprintf('ps %d', $pid), $state);
+ exec(sprintf('ps %d -o pid', $pid), $state);
201
+
202
+ // remove alignment spaces from PIDs
203
+ $state = array_map('trim', $state);
204
205
/*
206
* ps will return at least one row, the column labels.
207
* If the process is running ps will return a second row with its status.
208
+ *
209
+ * Fix: alpine ignores PID argument and always return all processes.
210
+ * Need to track if PID is not in result
211
- return 1 < count($state);
212
+ return 1 < count($state) && in_array($pid, $state);
213
}
214
215
/**
0 commit comments