summaryrefslogtreecommitdiffstats
path: root/application/clicommands/DaemonCommand.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/clicommands/DaemonCommand.php')
-rw-r--r--application/clicommands/DaemonCommand.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/application/clicommands/DaemonCommand.php b/application/clicommands/DaemonCommand.php
new file mode 100644
index 0000000..e89e1da
--- /dev/null
+++ b/application/clicommands/DaemonCommand.php
@@ -0,0 +1,26 @@
+<?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();
+ }
+}