From b08166fec2870f0cfc2859a121afc4c716baa2ee Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Fri, 6 Nov 2015 13:45:25 +0800 Subject: [PATCH] Check if the pid files exist --- xCAT/etc/logrotate.d/xcat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT/etc/logrotate.d/xcat b/xCAT/etc/logrotate.d/xcat index 65d1df063..f820f55e7 100644 --- a/xCAT/etc/logrotate.d/xcat +++ b/xCAT/etc/logrotate.d/xcat @@ -2,8 +2,8 @@ missingok sharedscripts postrotate - /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true - /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true - /bin/kill -HUP `cat /var/run/xcat/cmdlogservice.pid 2> /dev/null` 2> /dev/null || true + test -f /var/run/rsyslogd.pid && kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true + test -f /var/run/syslogd.pid && kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true + test -f /var/run/xcat/cmdlogservice.pid && kill -HUP `cat /var/run/xcat/cmdlogservice.pid 2> /dev/null` 2> /dev/null || true endscript }