1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 13:00:56 +01:00

Show daemon arguments with ./bin/phd status.

Summary: Fixes T4735. When running `./bin/phd`, show daemon arguments.

Test Plan:
```
./bin/phd status
PID  	Started                 	Daemon                                            Arguments
12711	May 20 2014, 9:02:52 AM 	PhabricatorRepositoryPullLocalDaemon              []
12716	May 20 2014, 9:02:52 AM 	PhabricatorGarbageCollectorDaemon                 []
12733	May 20 2014, 9:02:53 AM 	PhabricatorTaskmasterDaemon                       []
12768	May 20 2014, 9:02:53 AM 	PhabricatorTaskmasterDaemon                       []
12775	May 20 2014, 9:02:53 AM 	PhabricatorTaskmasterDaemon                       []
12780	May 20 2014, 9:02:54 AM 	PhabricatorTaskmasterDaemon                       []
12838	May 20 2014, 9:02:54 AM 	PhabricatorFactDaemon                             []
13436	May 20 2014, 9:03:23 AM 	PhabricatorRepositoryPullLocalDaemon              ["X","--not","Y"]
```

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T4735

Differential Revision: https://secure.phabricator.com/D9208
This commit is contained in:
Joshua Spence 2014-05-20 16:47:47 -07:00 committed by epriestley
parent b6d15377dd
commit eba11238b9
2 changed files with 14 additions and 6 deletions

View file

@ -23,10 +23,11 @@ final class PhabricatorDaemonManagementStatusWorkflow
$status = 0;
printf(
"%-5s\t%-24s\t%s\n",
"PID",
"Started",
"Daemon");
"%-5s\t%-24s\t%-50s%s\n",
'PID',
'Started',
'Daemon',
'Arguments');
foreach ($daemons as $daemon) {
$name = $daemon->getName();
if (!$daemon->isRunning()) {
@ -35,12 +36,13 @@ final class PhabricatorDaemonManagementStatusWorkflow
$name = '<DEAD> '.$name;
}
printf(
"%5s\t%-24s\t%s\n",
"%5s\t%-24s\t%-50s%s\n",
$daemon->getPID(),
$daemon->getEpochStarted()
? date('M j Y, g:i:s A', $daemon->getEpochStarted())
: null,
$name);
$name,
csprintf('%LR', $daemon->getArgv()));
}
return $status;

View file

@ -3,6 +3,7 @@
final class PhabricatorDaemonReference {
private $name;
private $argv;
private $pid;
private $start;
private $pidFile;
@ -13,6 +14,7 @@ final class PhabricatorDaemonReference {
$ref = new PhabricatorDaemonReference();
$ref->name = idx($dict, 'name', 'Unknown');
$ref->argv = idx($dict, 'argv', array());
$ref->pid = idx($dict, 'pid');
$ref->start = idx($dict, 'start');
@ -56,6 +58,10 @@ final class PhabricatorDaemonReference {
return $this->name;
}
public function getArgv() {
return $this->argv;
}
public function getEpochStarted() {
return $this->start;
}