[Pkg-nagios-devel] Bug#831794: icinga2-common: /lib/systemd/system/icinga2.service doesn't use ICINGA2_ERROR_LOG
Christoph Anton Mitterer
calestyo at scientia.net
Tue Jul 19 13:53:12 UTC 2016
Package: icinga2-common
Version: 2.4.10-1
Severity: normal
Hi Alex, et al.
I've just noted that the:
>ExecStart=/usr/sbin/icinga2 daemon -e ${ICINGA2_ERROR_LOG}
doesn't work as it seems it should, namely ICINGA2_ERROR_LOG
seems to be not available in that context and thus my daemon
e.g. runs as:
# ps ax | grep icinga
15798 ? Ssl 0:00 /usr/lib/x86_64-linux-gnu/icinga2/sbin/icinga2 --no-stack-rlimit daemon -e
This is somewhat related to #831533 and is AFAICs be solved by the comment
I gave in #831745 message 44, namely using the EnvironmentFile (see systemd.exec(5)) with a small
addition:
EnvironmentFile=/usr/lib/icinga2/icinga2
EnvironmentFile=-/etc/default/icinga2
This directive can apparently given multiple times, with later definitions overriding earlier ones,
which seems just what would be wanted here: take defaults from /usr/lib/icinga2/icinga2
and let the user override in /etc/default/icinga2.
The "-" means that it will not fail in case the file isn't readable. Since /usr/lib/icinga2/icinga2
should always be, and we actually need it, it very well can fail in that case.
According to systemd.service(5) these env vars seem to be actually usable in the unit itself.
I would perhaps also replace the comment in /etc/default/icinga2 with:
# Environment variables used within icinga2's system unit files as well
# as exportet by it do the daemon, with defaults read from /usr/lib/icinga2/icinga2.
# And default settings for icinga2's sys-v init-script.
As usual, if it helps, I could try to make a patch.
Cheers,
Chris.
More information about the Pkg-nagios-devel
mailing list