diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index 179d54784..3c7045dc0 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -213,11 +213,28 @@ if [ $isLinux -eq 0 ]; then if [[ -n "$state" && "$state" = "active" ]];then stopsrc -s syslogd fi - startsrc -s syslogd + + #wait for syslogd to fully started + RETRY_LIMIT=30 # number of 2 second retry intervals (60 second total) + let i=$RETRY_LIMIT + while : + do + ret=`LC_ALL=C startsrc -s syslogd 2>&1` + if [[ $ret == *PID* ]];then + break + fi + + i=$((i - 1)) + if (( i > 0 ));then + sleep 2 + else + break + fi + done else $init restart fi #keep a record -logger -t xcat "Install: syslog setup" +logger -t xCAT "Install: syslog setup" exit 0 diff --git a/xCAT/postscripts/xcataixpost b/xCAT/postscripts/xcataixpost index bccde47e5..cdc9438f9 100755 --- a/xCAT/postscripts/xcataixpost +++ b/xCAT/postscripts/xcataixpost @@ -9,6 +9,8 @@ use File::Path; use IO::Socket; +sleep int(rand(10)); + # since we don't have syslog set up yet we'll # just save msgs in a local log file $logdir = "/var/log/xcat";