icinga2/etc/logrotate.d/icinga2.cmake
Julian Brost 51ec73cbd9 Send signals as Icinga user in safe-reload and logrotate
In contrast to the regular `kill` binary, `icinga2 internal signal` drops
permissions before sending the signal. This is important as the PID file can be
written by the Icinga user, dropping the permissions prevents that user from
using this to send signals to processes it is not supposed to signal.

SIGUSR1 wasn't among the list of signals supported by `icinga2 internal
signal`, so it is added there.
2025-08-01 11:27:48 +02:00

22 lines
532 B
CMake

@ICINGA2_LOGDIR@/icinga2.log @ICINGA2_LOGDIR@/debug.log {
daily
rotate 7@LOGROTATE_USE_SU@
compress
delaycompress
missingok
notifempty@LOGROTATE_CREATE@
postrotate
@CMAKE_INSTALL_FULL_SBINDIR@/icinga2 internal signal --sig SIGUSR1 --pid "$(cat @ICINGA2_INITRUNDIR@/icinga2.pid 2> /dev/null)" 2> /dev/null || true
endscript
}
@ICINGA2_LOGDIR@/error.log {
daily
rotate 90@LOGROTATE_USE_SU@
compress
delaycompress
missingok
notifempty@LOGROTATE_CREATE@
# TODO: figure out how to get Icinga to re-open this log file
}