Make username in the logrotate config configurable.

Fixes #6295
This commit is contained in:
Gunnar Beutner 2014-05-26 09:01:23 +02:00
parent f9512dd495
commit 7183495d89
2 changed files with 7 additions and 6 deletions

View File

@ -17,7 +17,8 @@
include(InstallConfig) include(InstallConfig)
configure_file(icinga/icinga-classic-apache.conf.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga/icinga-classic-apache.conf) configure_file(icinga/icinga-classic-apache.conf.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga/icinga-classic-apache.conf @ONLY)
configure_file(logrotate.d/icinga2.cmake ${CMAKE_CURRENT_BINARY_DIR}/logrotate.d/icinga2 @ONLY)
install_if_not_exists(icinga2/icinga2.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2) install_if_not_exists(icinga2/icinga2.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
install_if_not_exists(icinga2/constants.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2) install_if_not_exists(icinga2/constants.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
@ -57,7 +58,7 @@ install_if_not_exists(icinga2/scripts/check_kernel ${CMAKE_INSTALL_SYSCONFDIR}/i
install_if_not_exists(icinga2/scripts/mail-host-notification.sh ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/scripts) install_if_not_exists(icinga2/scripts/mail-host-notification.sh ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/scripts)
install_if_not_exists(icinga2/scripts/mail-service-notification.sh ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/scripts) install_if_not_exists(icinga2/scripts/mail-service-notification.sh ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/scripts)
install_if_not_exists(icinga2/zones.d/README ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/zones.d) install_if_not_exists(icinga2/zones.d/README ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/zones.d)
install_if_not_exists(logrotate.d/icinga2 ${CMAKE_INSTALL_SYSCONFDIR}/logrotate.d) install_if_not_exists(${CMAKE_CURRENT_BINARY_DIR}/logrotate.d/icinga2 ${CMAKE_INSTALL_SYSCONFDIR}/logrotate.d)
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/pki\")") install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/pki\")")

View File

@ -1,11 +1,11 @@
/var/log/icinga2/icinga2.log /var/log/icinga2/debug.log { @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/icinga2.log @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/debug.log {
daily daily
rotate 7 rotate 7
compress compress
delaycompress delaycompress
missingok missingok
notifempty notifempty
create 644 icinga icinga create 644 @ICINGA2_USER@ @ICINGA2_GROUP@
copytruncate copytruncate
postrotate postrotate
if ! killall -q -USR1 icinga2; then if ! killall -q -USR1 icinga2; then
@ -14,14 +14,14 @@
endscript endscript
} }
/var/log/icinga2/error.log { @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/error.log {
daily daily
rotate 90 rotate 90
compress compress
delaycompress delaycompress
missingok missingok
notifempty notifempty
create 644 icinga icinga create 644 @ICINGA2_USER@ @ICINGA2_GROUP@
copytruncate copytruncate
# TODO: figure out how to get Icinga to re-open this log file # TODO: figure out how to get Icinga to re-open this log file
} }