1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Allow modern phd stop to stop old daemons cleanly

Summary:
Ref T7352. Make sure modern `phd stop` can still read the old PID file format and stop the daemons, at least for now.

Without this, `stop` still detects them and tells you to `stop --force`, which works, but this makes things a good deal cleaner.

Test Plan: Ran `phd stop` from master, then `phd stop` from this revision. Saw old daemons stop cleanly.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7352

Differential Revision: https://secure.phabricator.com/D11873
This commit is contained in:
epriestley 2015-02-23 18:46:24 -08:00
parent a3518e19a5
commit 38636a39cf

View file

@ -40,6 +40,20 @@ final class PhabricatorDaemonReference {
$logs = mpull($logs, null, 'getDaemonID');
}
// Support PID files that use the old daemon format, where each overseer
// had exactly one daemon. We can eventually remove this; they will still
// be stopped by `phd stop --force` even if we don't identify them here.
if (!$daemons && idx($dict, 'name')) {
$daemons = array(
array(
'config' => array(
'class' => idx($dict, 'name'),
'argv' => idx($dict, 'argv', array()),
),
),
);
}
foreach ($daemons as $daemon) {
$ref = new PhabricatorDaemonReference();