From a7ee19d7404527cf6d67a5ed2053dbf405933070 Mon Sep 17 00:00:00 2001 From: ligc Date: Mon, 19 Jan 2015 14:19:52 +0800 Subject: [PATCH] fix for bug 4448: check rsyslogd existence before running rsyslogd --- xCAT/postscripts/syslog | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index 7bf9c068f..d98339f96 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -205,13 +205,15 @@ fi # We only update the /etc/rsyslog.d/remote.conf file to point to the xcatmaster. # Do not even touch rsyslog.conf # There is no /etc/sysconfig/rsyslog file, so we use rsyslogd -v to get the version -SYSLOGPROD=`rsyslogd -v | grep rsyslogd |awk {'print $1'}` -SYSLOGVER=`rsyslogd -v | grep rsyslogd |awk {'print $2'}` -if ( pmatch $SYSLOGPROD "*rsyslogd*" ) && ( pmatch $SYSLOGVER "8*" ); then - config_rsyslog_V8 -#keep a record - logger -t xCAT -p local4.info "Install: rsyslog version 8 setup" - exit 0 +if [ -e "/sbin/rsyslogd" -o -e "/usr/sbin/rsyslogd" ]; then + SYSLOGPROD=`rsyslogd -v | grep rsyslogd |awk {'print $1'}` + SYSLOGVER=`rsyslogd -v | grep rsyslogd |awk {'print $2'}` + if ( pmatch $SYSLOGPROD "*rsyslogd*" ) && ( pmatch $SYSLOGVER "8*" ); then + config_rsyslog_V8 + #keep a record + logger -t xCAT -p local4.info "Install: rsyslog version 8 setup" + exit 0 + fi fi if [ "$(uname -s)" = "Linux" ]; then