From: Gunnar Beutner Date: Mon, 20 Apr 2015 09:15:59 +0000 (+0200) Subject: logrotate: Check whether the PID file exists X-Git-Tag: v2.4.0~719 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4214329bb6a23d69521df0b785cf00d957a42dc5;p=icinga2 logrotate: Check whether the PID file exists refs #8808 --- diff --git a/etc/logrotate.d/icinga2.cmake b/etc/logrotate.d/icinga2.cmake index 25e627f77..ba95e7bd7 100644 --- a/etc/logrotate.d/icinga2.cmake +++ b/etc/logrotate.d/icinga2.cmake @@ -7,8 +7,10 @@ notifempty create 644 @ICINGA2_USER@ @ICINGA2_GROUP@ postrotate - if ! kill -l USR1 `cat @ICINGA2_RUNDIR@/icinga2/icinga2.pid`; then - exit 1 + if service icinga2 status > /dev/null; then + if [ -e @ICINGA2_RUNDIR@/icinga2/icinga2.pid ]; then + kill -USR1 $(cat @ICINGA2_RUNDIR@/icinga2/icinga2.pid) + fi fi endscript }