1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 08:12:40 +01:00

phd - on start command accurately detect if daemons are running before erroring out

Summary: loadRunningDaemons loads daemons that may be running (have a file pid). other commands handle this appropriately so just make sure the start command knows whats up

Test Plan: phd start, stop, reload all seemed to work just fine.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1284

Differential Revision: https://secure.phabricator.com/D2808
This commit is contained in:
Bob Trahan 2012-06-20 12:36:31 -07:00
parent a4e2eb3d8c
commit 26ca5cbbe3

View file

@ -56,7 +56,11 @@ switch ($command) {
/* Fall Through */
case 'start':
$running = $control->loadRunningDaemons();
if ($running) {
// "running" might not mean actually running so much as was running at
// some point. ergo, do a quick grouping and only barf if daemons are
// *actually* running.
$running_dict = mgroup($running, 'isRunning');
if (!empty($running_dict[true])) {
echo phutil_console_wrap(
"phd start: Unable to start daemons because daemons are already ".
"running.\n".