Open mrimann opened 4 years ago
I had the same problem with Uvuntu 20.04, because the owner of the files under /etc/icinga2/features-{available,enabled} is not nagios (which is the user for icinga2) its root after installing the packages.
Simple workaround after installing the packages is
chown -R nagios:nagios /etc/icinga2
Thanks - we'll try that out.
Yes, setting the permissions for /etc/icinga2/features-*
seems to work (we do that automated via Puppet after the package-install).
@htriem Do you consider it good practice to fix https://github.com/Icinga/icinga2/issues/8111#issuecomment-659330323 at packaging level, i.e. to install that files/dirs as nagios:nagios?
PING
I've done some tests, and so far it looks like it might be a usable workaround. I don't entirely feel comfortable with this option though, using the nagios-user. I wonder about options we might have using permissions or even supplementing our docs in a way to avoid this issue.
I don't entirely feel comfortable with this option though, using the nagios-user.
OK. And... why exactly?
Honestly, it just doesn't feel right using the nagios-user when we ship a Icinga user through our packages.
Our Debian/Ubuntu packages still use the nagios
user. Probably for historical reason and/or compatibility with the packages provided by Debian itself.
OK... details matter.
@htriem Do you consider it good practice to fix #8111 (comment) at packaging level, i.e. to install that files/dirs as $ICINGA2_USER$:$ICINGA2_GROUP$?
Describe the bug
We install icinga2 clients via some automation. Basically just adding the package repo, signing key, then install the package + configure the node + request certificate signing.
This worked like a charm in Ubuntu 16.04 and 18.04 and we ported our setup for Ubuntu 20.04 hosts. But executing the exact same
node setup
cli command results in an Api config that denies to accept config and commands.To Reproduce
We execute the following command to configure the icinga2 node:
After signing the certificate of the node on the master and restarting the icinga2 client on the node, we see the following in the log file:
The config file for the api module in
/etc/icinga2/features-enabled/api.conf
is configured to deny the delivered config:Workarounds
Workaround A - manual fix
Editing
/etc/icinga2/features-enabled/api.conf
to be like below, then restaring the icinga2 service - everything works as is should:Workaround B - automated fix
Did not try that, but applying the above mentionec correction can also be delivered via our automation. But since this worked all the years, I suspect this to be a bug in some way, and just "covering" that by automated overriding of the config files feels a bit wrong.
Expected behavior
The config should be synced from the master and the received config shall be applied and the checks starting to be executed.
Your Environment