From 672f1e8bd58f096a8072986a89573e997c762807 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 3 Nov 2016 04:21:57 -0400 Subject: [PATCH] modified depending on comments --- xCAT-genesis-scripts/bin/doxcat | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index 9c052b313..fa78b4677 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -271,14 +271,19 @@ fi # rv 0 state does not work with the new ntp versions while [ "`ntpq -c 'rv 0 offset' | awk -F '=' '/offset=/ { print $2 }' | awk -F '.' '{ print $1 }' | sed s/-//`" -ge 1000 ]; do - echo `ntpq -c 'rv 0 offset` sleep 1 done -kill `cat /var/run/syslogd.pid` -sleep 3 -RSYSLOGD_VERSION=`rsyslogd -v | grep "rsyslogd" | cut -d" " -f2 | cut -d"." -f1` -if [ $RSYSLOGD_VERSION -ge 8 ]; then +read -r RSYSLOG_PID /dev/null +kill "$RSYSLOG_PID" 2>/dev/null +while kill -0 "$RSYSLOG_PID" 2>/dev/null +do + sleep 0.5 +done +unset RSYSLOG_PID + +RSYSLOGD_VERSION=`rsyslogd -v | awk '/rsyslogd/ { split($2, a, "."); print a[1]; }'` +if [ "$RSYSLOGD_VERSION" -ge 8 ]; then /sbin/rsyslogd else /sbin/rsyslogd -c4 @@ -330,7 +335,8 @@ while :; do /bin/getcert $XCATMASTER:$XCATPORT destiny='' dest='' - touch /tmp/xcatgenesisdiscovery + DISCOVERYDONE=1 + export DISCOVERYDONE elif [ "$dest" = shell ]; then logger -s -t $log_label -p local4.info "Dropping to debug shell(exit to run next destiny)..." destiny='' @@ -394,7 +400,7 @@ while :; do delay=$((30+$RANDOM%270)) while [ $delay -gt 0 ]; do if [ $((delay%10)) == 0 ]; then - if [ -e "/tmp/xcatgenesisdiscovery" ]; then + if [ $DISCOVERYDONE == 1 ]; then logger -s -t $log_label -p local4.info "Received request=$dest, will call xCAT back in $delay seconds. Discovery is complete, run nodeset on this node to provision an Operating System" else logger -s -t $log_label -p local4.info "Received request to retry in a bit, will call xCAT back in $delay seconds"