mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
- try to detect a recent logrotate version which supports the 'su'
directive (added in 3.8.0, see
5be96cf182 (diff-e4eb329834da3d36278b1b7d943b3bc9R6)
)
- if logrotate can't be found, assume an old version is used
- allow the parameter to be forced by the user
fixes #9249
Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
25 lines
618 B
CMake
25 lines
618 B
CMake
@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/icinga2.log @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/debug.log {
|
|
daily
|
|
rotate 7@LOGROTATE_USE_SU@
|
|
compress
|
|
delaycompress
|
|
missingok
|
|
notifempty
|
|
create 644 @ICINGA2_USER@ @ICINGA2_GROUP@
|
|
postrotate
|
|
/bin/kill -USR1 $(cat @ICINGA2_RUNDIR@/icinga2/icinga2.pid 2> /dev/null) 2> /dev/null || true
|
|
endscript
|
|
}
|
|
|
|
@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/error.log {
|
|
daily
|
|
rotate 90@LOGROTATE_USE_SU@
|
|
compress
|
|
delaycompress
|
|
missingok
|
|
notifempty
|
|
create 644 @ICINGA2_USER@ @ICINGA2_GROUP@
|
|
# TODO: figure out how to get Icinga to re-open this log file
|
|
}
|
|
|