From c1673f730b485f2a2aed1dcff03251ff0896e410 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 12 Dec 2016 15:43:17 -0500 Subject: [PATCH] Since the genesis kernel is not intended to be long running, there's no need to start ntp daemon, simply attempt to sync with ntpdate. There's an issue in this code where we query ntpq for the offset too quickly after starting the ntp daemon. This causes the offset to always be 0 and we continue. We have seen situations where ntpd starts before the first check and becomes > 1000. Then it takes 15 minutes before the 2nd attempt and delays the hardware discovery process --- xCAT-genesis-scripts/bin/doxcat | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index 6a637fb91..f57234a49 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -260,11 +260,10 @@ fi openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 & logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic" - ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}' -logger -s -t $log_label -p local4.info "Starting ntpd..." -ntpd -g -x +logger -s -t $log_label -p local4.info "Attempting to sync the date with $XCATMASTER..." +ntpdate $XCATMASTER if [ -e "/dev/rtc" ]; then logger -s -t $log_label -p local4.info "Attempting to sync hardware clock..." @@ -272,13 +271,6 @@ if [ -e "/dev/rtc" ]; then disown fi -# rv 0 state does not work with the new ntp versions -logger -s -t $log_label -p local4.info "Checking ntpq for the offset values..." -while [ "`ntpq -c 'rv 0 offset' | awk -F '=' '/offset=/ { print $2 }' | awk -F '.' '{ print $1 }' | sed s/-//`" -ge 1000 ]; do - sleep 1 -done -logger -s -t $log_label -p local4.info "Checking ntpq for the offset values... Done" - logger -s -t $log_label -p local4.info "Restarting syslog..." read -r RSYSLOG_PID /dev/null kill "$RSYSLOG_PID" 2>/dev/null