1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

Don't SIGINT ourselves on bad daemon data

Summary:
If daemon data is mangled, `bin/phd restart` will SIGINT process `0`, which kills it.

uh oh T.T so sad

Test Plan: Used `bin/phd start` to start daemons; removed PID information from one; saw `bin/phd stop` shut down cleanly and not kill itself.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: mholden, epriestley

Differential Revision: https://secure.phabricator.com/D10308
This commit is contained in:
epriestley 2014-08-20 13:18:17 -07:00
parent 8dd4d5cfe5
commit 15385e1fe9

View file

@ -357,6 +357,12 @@ abstract class PhabricatorDaemonManagementWorkflow
$pid = $daemon->getPID(); $pid = $daemon->getPID();
$name = $daemon->getName(); $name = $daemon->getName();
if (!$pid) {
$console->writeOut("%s\n", pht("Daemon '%s' has no PID!", $name));
unset($daemons[$key]);
continue;
}
switch ($signo) { switch ($signo) {
case SIGINT: case SIGINT:
$message = pht("Interrupting daemon '%s' (%s)...", $name, $pid); $message = pht("Interrupting daemon '%s' (%s)...", $name, $pid);