mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 14:30:56 +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:
parent
8dd4d5cfe5
commit
15385e1fe9
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue