1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +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:
epriestley 2012-01-19 11:06:05 -08:00
parent 8b4b614d15
commit ff339e152e

View file

@ -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];