icinga2.service used `-e ${ICINGA2_ERROR_LOG}`, but this is documented
as having no effect without `-d`. Furthermore, icinga2 under systemd
unconditionally logged everything to the system log (but without setting
the log level etc), which contradicted the documentation. (Issue #6339)
Stop icinga2 on systemd from logging to stdout - and hence the system log -
once it has finished starting up. Just like when you start icinga2 from a
terminal using `-d`. And just like -d, we stop logging fatal errors to
stderr, and instead write to the log file passed with `-e`.
As per docs, mainlog (icinga2.log) is already enabled by default. And
pre-startup messages including config errors will still appear in the
system log.
This uses a new option --close-stdio, which has the same effect on logging as
--daemonize, but does not fork or call setsid().
For this purpose, I moved setsid() up and into Daemonize().
Consequence of that last point: if anyone is weird enough to specify a TTY
device file as the fatal error log (-e option), that will become icinga's
controlling terminal, which you generally don't want as a daemon. This
makes it consistent with the existing behaviour for icinga mainlog. For
this reason you're supposed to use O_NOCTTY in Linux daemons. But I wasn't
sure where icinga would want to put the ugly `#ifdef _WIN32 ... #else ...`.
This reverts commit 592fb22c7f.
We have the problem that Systemd doesn't expand shell variables
into our environment.
During the upgrade cycle this would maybe render a wrong PID file
location, thus resulting in wrong 'safe-reload' behaviour.
This is only for a clean upgrade path from 2.8.x to 2.9.0,
the proper fix is to ensure that the sysconfig file is empty
and keep our own defaults, or modified from the user.
refs #6434
The sysconfig file now only contains the defaults as comments, changes
made there are given to the init.d script, prepare-dirs, safe-reload and
Icinga 2 itself. If nothing is set in the sysconfig file (as is the
default as all lines are commented out) the defaults are used.
fixes#6255
This better reflects its purpose as otherwise it would imply
that you need Elastic Stack for it. Graylog also reads from
Elasticsearch instances, this could serve as additional integration
here.
Main focus: Object attributes and their value types. Originates from the
API Event Streams patch to document their value types. Now applied to
the entire configuration objects chapter.
The API chapter and their value types has been changed to capitalized
type identifiers.
Value types are now explicitly told about inside monitoring basics. This
has been adopted into the Icinga 2 training material a long time ago
and finds its way into the docs too.
The CheckResult and PerfdataValue value types have been moved into the
advanced topics chapter. mkdocs doesn't like multiple `#` headings in one file
and did just hide it.
Also moved the Influxdb details into the features documentation where it
belongs.
Many small references and URLs to other chapters added.
E.g. dedicated chapters for object accessor examples, to better link against
time dependent thresholds.
Can serve as patch basis and reference for ITL documentation where the
value types are missing too.
This commit also fixes the non-requirement of "legacy-timeperiod" which
also is a default template import since 2.6.
This also fixes the state mapping issue.
fixes#4015
This also disables setting a value by default.
Packaging should decide to install the config file:
`/etc/systemd/system/icinga2.service.d`
fixes#5611
Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>