mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01: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:
parent
a3518e19a5
commit
38636a39cf
1 changed files with 14 additions and 0 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue