Pass overseer configuration over stdin

Summary:
Ref T7352. This changes `phd` to pass configuration to overseers over stdin. We still run one overseer per daemon.

The "status" stuff needs some cleanup, but it's mostly just UI/cosmetic.

Test Plan:
  - Ran `phd debug`, `phd launch`, `phd start`, `phd status`, `phd stop`, etc.
  - Verified PID files write in a reasonable format.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7352

Differential Revision: https://secure.phabricator.com/D11855
This commit is contained in:
epriestley
2015-02-22 08:43:19 -08:00
parent 6771a70499
commit 09f3d0bb7e
3 changed files with 45 additions and 28 deletions

View File

@@ -8,20 +8,11 @@
$root = dirname(dirname(dirname(__FILE__)));
require_once $root.'/scripts/__init_script__.php';
$flags = array();
$overseer = new PhutilDaemonOverseer($argv);
$bootloader = PhutilBootloader::getInstance();
foreach ($bootloader->getAllLibraries() as $library) {
if ($library == 'phutil') {
// No need to load libphutil, it's necessarily loaded implicitly by the
// daemon itself.
continue;
}
$flags[] = '--load-phutil-library='.phutil_get_library_root($library);
$overseer->addLibrary(phutil_get_library_root($library));
}
// Add more flags.
array_splice($argv, 2, 0, $flags);
$overseer = new PhutilDaemonOverseer($argv);
$overseer->run();