New background daemon fails to start as non-root

Hi there,
I just upgraded to the new 1.7.x release of Director from GIT (using master), installed the dependencies and ran the DB schema migration scripts. No problems, everything went flawless.
As the new background daemon is mandatory to set up, I followed the instructions in the documentation.

Starting the daemon with service icinga-director start does not immediately return an error, but icingaweb2 complains about the daemon not running.

A check with “service icinga-director status” yields:
Oct 07 12:44:52 ifbsapnag systemd[1]: Starting Icinga Director - Monitoring Configuration...
Oct 07 12:44:52 ifbsapnag icingadirector[7838]: Started by systemd, notifying watchdog every 5s via /run/systemd/notify
Oct 07 12:44:52 ifbsapnag systemd[1]: Started Icinga Director - Monitoring Configuration.
Oct 07 12:44:52 ifbsapnag icingadirector[7838]: DB configuration is not valid

But my director DB config seems valid when checking in the ressources section.

What puzzles me most ist that running
icingacli director daemon run
as root does obviously start the daemon successfully, as icingaweb2 recognizes the PID and related information.

What can I check to get the process running as icingadirector user as proposed by the documentation?

I’m running Debian 10.1 x64.

Thanks in advance!
Andreas

Did you create the icingadirector user on you system?
Details see Background Daemon Help

Greetings,
Manfred

Manfred,
thanks for your reply.
But as I said above I followed the documentation (and did create the icingadirector user, of course) :slight_smile:
Anyway, got it working now - but I am unsure about what did the trick

  • added nagios group to icingadirector user
  • added www-data group to icingadirector user
  • bounced icinga2 service
  • stopped and startet icinga-director service

Anyway, it’s working now as expected. Problem solved :angel:

Hi,
I can confirm the issue - some requirements according to the permissions are missing in the manual.
(Tested on CentOS 7)

Kind Regards
Sebastian

– Unit icinga-director.service has begun starting up.
Okt 08 09:31:55 servername.domain.foo icingadirector[23053]: Icinga\Exception\IcingaException in /usr/share/php/Icinga/Application/ApplicationBootstrap.php:524 with message: Cannot load application configuration. An exception was thrown: <- Icinga\Exception\NotReadableError in /usr/share/php/Icinga/Application/Config.php:328 with message: Cannot read config file “/etc/icingaweb2/config.ini”. Permission denied
Okt 08 09:31:55 servername.domain.foo icingadirector[23053]: Icinga\Exception\IcingaException in /usr/share/php/Icinga/Application/ApplicationBootstrap.php:595 with message: Cannot load user backend configuration. An exception was thrown: <- Icinga\Exception\NotReadableError in /usr/share/php/Icinga/Application/Config.php:328 with message: Cannot read config file “/etc/icingaweb2/authentication.ini”. Permission denied
Okt 08 09:31:55 servername.domain.foo icingadirector[23053]: ERROR: Cannot read enabled modules. Module directory “/etc/icingaweb2/enabledModules” is not readable
Okt 08 09:31:55 servername.domain.foo systemd[1]: icinga-director.service: main process exited, code=exited, status=1/FAILURE
Okt 08 09:31:55 servername.domain.foo systemd[1]: Failed to start Icinga Director - Monitoring Configuration.
– Subject: Unit icinga-director.service has failed

Hmmm which one’s exactly? I moved the steps from the documentation into my Puppet profile and it worked OOTB.

Cheers,
Michael

/etc/icingaweb2/config.ini and /etc/icingaweb2/authentication.ini
are owend by apache

so…

usermod -a -G apache icingadirector

worked

The RPM package uses the icingaweb2 by default for this purpose. Seems you have modified the permissions or used a different source to install Icinga Web.

@dnsmichi friedrich
Fixed the filesystem permissions accordingly now it works without the additional group
Thanks for your support