Skip to content

Commit 26ca5cb

Browse files
committed
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
1 parent a4e2eb3 commit 26ca5cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/daemon/phabricator_daemon_launcher.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ function must_have_extension($ext) {
5656
/* Fall Through */
5757
case 'start':
5858
$running = $control->loadRunningDaemons();
59-
if ($running) {
59+
// "running" might not mean actually running so much as was running at
60+
// some point. ergo, do a quick grouping and only barf if daemons are
61+
// *actually* running.
62+
$running_dict = mgroup($running, 'isRunning');
63+
if (!empty($running_dict[true])) {
6064
echo phutil_console_wrap(
6165
"phd start: Unable to start daemons because daemons are already ".
6266
"running.\n".

0 commit comments

Comments
 (0)