icingaweb2-module-director/application/clicommands/DaemonCommand.php

27 lines
624 B
PHP
Raw Normal View History

2019-09-17 15:06:39 +02:00
<?php
namespace Icinga\Module\Director\Clicommands;
use Icinga\Module\Director\Cli\Command;
use Icinga\Module\Director\Daemon\BackgroundDaemon;
class DaemonCommand extends Command
{
/**
* Run the main Director daemon
*
* USAGE
*
* icingacli director daemon run [--db-resource <name>]
*/
public function runAction()
{
$this->app->getModuleManager()->loadEnabledModules();
$daemon = new BackgroundDaemon();
if ($dbResource = $this->params->get('db-resource')) {
$daemon->setDbResourceName($dbResource);
}
$daemon->run();
}
}