mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-16 03:10:36 +00:00
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
This commit is contained in:
@ -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 </var/run/syslogd.pid 2>/dev/null
|
||||
kill "$RSYSLOG_PID" 2>/dev/null
|
||||
|
Reference in New Issue
Block a user