logrotate: Check whether the PID file exists

refs #8808
This commit is contained in:
Gunnar Beutner 2015-04-20 11:15:59 +02:00
parent 5baa837c8d
commit 4214329bb6
1 changed files with 4 additions and 2 deletions

View File

@ -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
}