mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +01:00
Improve error message for "phd stop" with bad PID
Summary: "phd launch ircbot" works but "phd stop ircbot" gives you a potentially confusing message. Improve messaging. Test Plan: Ran "phd stop ircbot", "phd stop 87888" (actual PID) Reviewers: btrahan, jungejason Reviewed By: btrahan CC: aran Maniphest Tasks: T791 Differential Revision: https://secure.phabricator.com/D1457
This commit is contained in:
parent
8b4b614d15
commit
ff339e152e
1 changed files with 5 additions and 2 deletions
|
@ -84,8 +84,11 @@ final class PhabricatorDaemonControl {
|
|||
} else {
|
||||
// We were given a PID or set of PIDs to kill.
|
||||
foreach ($pids as $key => $pid) {
|
||||
if (empty($daemons[$pid])) {
|
||||
echo "{$pid} is not Phabricator-controlled. Not killing.\n";
|
||||
if (!preg_match('/^\d+$/', $pid)) {
|
||||
echo "'{$pid}' is not a valid PID.\n";
|
||||
continue;
|
||||
} else if (empty($daemons[$pid])) {
|
||||
echo "'{$pid}' is not Phabricator-controlled PID. Not killing.\n";
|
||||
continue;
|
||||
} else {
|
||||
$running[] = $daemons[$pid];
|
||||
|
|
Loading…
Reference in a new issue