Summary: Ref T4209. Unifies the local (`./bin/phd status`) and global (`./bin/phd status --all`) view into a single table. This generally makes it easy to administer daemons running across multiple hosts. Depends on D9606. Test Plan: ``` > sudo ./bin/phd status ID Host PID Started Daemon Arguments 38 localhost 2282 Jun 18 2014, 7:52:56 AM PhabricatorRepositoryPullLocalDaemon 39 localhost 2289 Jun 18 2014, 7:52:57 AM PhabricatorGarbageCollectorDaemon 40 localhost 2294 Jun 18 2014, 7:52:57 AM PhabricatorTaskmasterDaemon 41 localhost 2314 Jun 18 2014, 7:52:58 AM PhabricatorTaskmasterDaemon 42 localhost 2319 Jun 18 2014, 7:52:59 AM PhabricatorTaskmasterDaemon 43 localhost 2328 Jun 18 2014, 7:53:00 AM PhabricatorTaskmasterDaemon 44 localhost 2354 Jun 18 2014, 7:53:08 AM PhabricatorRepositoryPullLocalDaemon X --not Y ``` Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T4209 Differential Revision: https://secure.phabricator.com/D9607
54 lines
1.2 KiB
PHP
54 lines
1.2 KiB
PHP
<?php
|
|
|
|
final class PhabricatorDaemonLog extends PhabricatorDaemonDAO
|
|
implements PhabricatorPolicyInterface {
|
|
|
|
const STATUS_UNKNOWN = 'unknown';
|
|
const STATUS_RUNNING = 'run';
|
|
const STATUS_DEAD = 'dead';
|
|
const STATUS_WAIT = 'wait';
|
|
const STATUS_EXITED = 'exit';
|
|
|
|
protected $daemon;
|
|
protected $host;
|
|
protected $pid;
|
|
protected $argv;
|
|
protected $explicitArgv;
|
|
protected $status;
|
|
|
|
public function getConfiguration() {
|
|
return array(
|
|
self::CONFIG_SERIALIZATION => array(
|
|
'argv' => self::SERIALIZATION_JSON,
|
|
'explicitArgv' => self::SERIALIZATION_JSON,
|
|
),
|
|
) + parent::getConfiguration();
|
|
}
|
|
|
|
|
|
/* -( PhabricatorPolicyInterface )----------------------------------------- */
|
|
|
|
public function getPHID() {
|
|
return null;
|
|
}
|
|
|
|
public function getCapabilities() {
|
|
return array(
|
|
PhabricatorPolicyCapability::CAN_VIEW,
|
|
);
|
|
}
|
|
|
|
public function getPolicy($capability) {
|
|
return PhabricatorPolicies::POLICY_ADMIN;
|
|
}
|
|
|
|
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
|
|
return false;
|
|
}
|
|
|
|
public function describeAutomaticCapability($capability) {
|
|
return null;
|
|
}
|
|
|
|
}
|