diff --git a/xCAT/etc/logrotate.d/xcat b/xCAT/etc/logrotate.d/xcat index da6a2746c..f820f55e7 100644 --- a/xCAT/etc/logrotate.d/xcat +++ b/xCAT/etc/logrotate.d/xcat @@ -2,7 +2,8 @@ missingok sharedscripts postrotate - /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 } diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index 6a807aad4..1b0aa07b4 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -102,7 +102,7 @@ config_Rsyslog_C3() if [ $isLocal -eq 1 ]; then #enable the MN to log all the logs from CN and MN itself sed -i 's/\(^[^\#].*\/var\/log\/messages\)/\#\1/g' $2 - echo "*.debug /var/log/messages" >> $2 + echo "#*.debug /var/log/messages" >> $2 touch /var/log/messages if ( pmatch $OSVER "ubuntu*" ) || ( is_lsb_ubuntu ) || ( pmatch $OSVER "debian*" ); then chown syslog:adm /var/log/messages @@ -174,7 +174,7 @@ config_rsyslog_V8() sed -i '/^[^#].*\/var\/log\/messages/s/^/#/' $conf_file echo "# xCAT settings" >> $conf_file - echo "*.debug /var/log/messages" >> $conf_file + echo "#*.debug /var/log/messages" >> $conf_file # Need to uncomment the lines $ModLoad imudp.so and $UDPServerRun 514, # to make the MN be able to receive syslog from remote hosts if [ -f "$remoteconf" ]; then