mirror of https://github.com/Icinga/icinga2.git
a21166dcf8
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 ...`. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
apisetupcommand.cpp | ||
apisetupcommand.hpp | ||
apisetuputility.cpp | ||
apisetuputility.hpp | ||
calistcommand.cpp | ||
calistcommand.hpp | ||
casigncommand.cpp | ||
casigncommand.hpp | ||
clicommand.cpp | ||
clicommand.hpp | ||
consolecommand.cpp | ||
consolecommand.hpp | ||
daemoncommand.cpp | ||
daemoncommand.hpp | ||
daemonutility.cpp | ||
daemonutility.hpp | ||
editline.hpp | ||
featuredisablecommand.cpp | ||
featuredisablecommand.hpp | ||
featureenablecommand.cpp | ||
featureenablecommand.hpp | ||
featurelistcommand.cpp | ||
featurelistcommand.hpp | ||
featureutility.cpp | ||
featureutility.hpp | ||
i2-cli.hpp | ||
internalsignalcommand.cpp | ||
internalsignalcommand.hpp | ||
nodesetupcommand.cpp | ||
nodesetupcommand.hpp | ||
nodeutility.cpp | ||
nodeutility.hpp | ||
nodewizardcommand.cpp | ||
nodewizardcommand.hpp | ||
objectlistcommand.cpp | ||
objectlistcommand.hpp | ||
objectlistutility.cpp | ||
objectlistutility.hpp | ||
pkinewcacommand.cpp | ||
pkinewcacommand.hpp | ||
pkinewcertcommand.cpp | ||
pkinewcertcommand.hpp | ||
pkirequestcommand.cpp | ||
pkirequestcommand.hpp | ||
pkisavecertcommand.cpp | ||
pkisavecertcommand.hpp | ||
pkisigncsrcommand.cpp | ||
pkisigncsrcommand.hpp | ||
pkiticketcommand.cpp | ||
pkiticketcommand.hpp | ||
troubleshootcommand.cpp | ||
troubleshootcommand.hpp | ||
variablegetcommand.cpp | ||
variablegetcommand.hpp | ||
variablelistcommand.cpp | ||
variablelistcommand.hpp | ||
variableutility.cpp | ||
variableutility.hpp |