diff --git a/conf/default.conf.php b/conf/default.conf.php --- a/conf/default.conf.php +++ b/conf/default.conf.php @@ -940,10 +940,12 @@ // Directory that the Phabricator daemons should use to store the log file 'phd.log-directory' => '/var/tmp/phd/log', - // Number of "TaskMaster" daemons that "phd start" should start. You can - // raise this if you have a task backlog, or explicitly launch more with - // "phd launch taskmaster". - 'phd.start-taskmasters' => 4, + // Daemons that "phd start" should start. + 'phd.start-daemons' => array( + 'PhabricatorTaskmasterDaemon' => 4, + 'PhabricatorRepositoryPullLocalDaemon' => 1, + 'PhabricatorGarbageCollectorDaemon' => 1, + ), // Launch daemons in "verbose" mode by default. This creates a lot of output, // but can help debug issues. Daemons launched in debug mode with "phd debug" diff --git a/src/applications/config/option/PhabricatorPHDConfigOptions.php b/src/applications/config/option/PhabricatorPHDConfigOptions.php --- a/src/applications/config/option/PhabricatorPHDConfigOptions.php +++ b/src/applications/config/option/PhabricatorPHDConfigOptions.php @@ -21,13 +21,18 @@ ->setDescription( pht( "Directory that the daemons should use to store log files.")), - $this->newOption('phd.start-taskmasters', 'int', 4) - ->setSummary(pht("Number of TaskMaster daemons to start by default.")) + $this->newOption( + 'phd.start-daemons', + 'map>>', + array( + 'PhabricatorTaskmasterDaemon' => 4, + 'PhabricatorRepositoryPullLocalDaemon' => 1, + 'PhabricatorGarbageCollectorDaemon' => 1, + )) + ->setLocked(true) + ->setSummary(pht('Daemons to start by default.')) ->setDescription( - pht( - "Number of 'TaskMaster' daemons that 'phd start' should start. ". - "You can raise this if you have a task backlog, or explicitly ". - "launch more with 'phd launch taskmaster'.")), + pht('Number and type of daemons that `phd start` should start.')), $this->newOption('phd.verbose', 'bool', false) ->setBoolOptions( array( diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php --- a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php +++ b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php @@ -229,14 +229,19 @@ } } - $daemons = array( - array('PhabricatorRepositoryPullLocalDaemon', array()), - array('PhabricatorGarbageCollectorDaemon', array()), - ); - - $taskmasters = PhabricatorEnv::getEnvConfig('phd.start-taskmasters'); - for ($ii = 0; $ii < $taskmasters; $ii++) { - $daemons[] = array('PhabricatorTaskmasterDaemon', array()); + $daemons = array(); + $start_daemons = PhabricatorEnv::getEnvConfig('phd.start-daemons'); + + foreach ($start_daemons as $daemon => $spec) { + if (is_integer($spec)) { + for ($ii = 0; $ii < $spec; $ii++) { + $daemons[] = array($daemon, array()); + } + } else { + foreach ($spec as $argv) { + $daemons[] = array($daemon, $argv); + } + } } $this->willLaunchDaemons();