Merge pull request #7065 from uubk/logrotate-fix

Fix logrotate "Operation not permitted"
This commit is contained in:
Michael Friedrich 2019-07-08 09:47:18 +02:00 committed by GitHub
commit aabfcfef9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -148,6 +148,8 @@ if(NOT DEFINED LOGROTATE_HAS_SU)
endif()
if(LOGROTATE_HAS_SU)
set(LOGROTATE_USE_SU "\n\tsu ${ICINGA2_USER} ${ICINGA2_GROUP}")
else()
set(LOGROTATE_CREATE "\n\tcreate 644 ${ICINGA2_USER} ${ICINGA2_GROUP}")
endif()
find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS context coroutine date_time filesystem thread system program_options regex REQUIRED)

View File

@ -4,8 +4,7 @@
compress
delaycompress
missingok
notifempty
create 644 @ICINGA2_USER@ @ICINGA2_GROUP@
notifempty@LOGROTATE_CREATE@
postrotate
/bin/kill -USR1 $(cat @ICINGA2_INITRUNDIR@/icinga2.pid 2> /dev/null) 2> /dev/null || true
endscript
@ -17,7 +16,6 @@
compress
delaycompress
missingok
notifempty
create 644 @ICINGA2_USER@ @ICINGA2_GROUP@
notifempty@LOGROTATE_CREATE@
# TODO: figure out how to get Icinga to re-open this log file
}