]> granicus.if.org Git - icinga2/commitdiff
Fix logrotate configuration
authorJean-Marcel Flach <jean-marcel.flach@netways.de>
Tue, 31 Mar 2015 10:14:43 +0000 (12:14 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 20 Apr 2015 06:54:17 +0000 (08:54 +0200)
refs #8868 fixes #8808

etc/logrotate.d/icinga2.cmake

index 543ae5ce2936a33cb075bc83c3ca0ffec52fd158..b573a3b09d206ae033e512b2d6b3b20f068a2bc3 100644 (file)
@@ -1,30 +1,26 @@
-@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/icinga2.log @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/debug.log {
-               daily
+@MAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/icinga2.log @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/debug.log {
+       daily
        rotate 7
-       su @ICINGA2_USER@ @ICINGA2_GROUP@
        compress
        delaycompress
-               missingok
-               notifempty
-               create 644 @ICINGA2_USER@ @ICINGA2_GROUP@
-       copytruncate
+       missingok
+       notifempty
+       create 644 @ICINGA2_USER@ @ICINGA2_GROUP@
        postrotate
-               if ! killall -q -USR1 icinga2; then
+               if ! kill -l USR1 `cat @ICINGA2_RUNDIR@/icinga2/icinga2.pid`; then
                        exit 1
-               fi
-               endscript
+               fi      
+       endscript
 }
 
 @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/error.log {
        daily
-       su @ICINGA2_USER@ @ICINGA2_GROUP@
        rotate 90
        compress
        delaycompress
        missingok
        notifempty
        create 644 @ICINGA2_USER@ @ICINGA2_GROUP@
-       copytruncate
        # TODO: figure out how to get Icinga to re-open this log file
 }