2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Merge pull request #1789 from neo954/issue1591ntpq

Fix github issue #1591
This commit is contained in:
zet809 2016-08-31 16:54:29 +08:00 committed by GitHub
commit 5e9c3a90b0

View File

@ -274,14 +274,17 @@ 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}'
ntpd -g -x
if [ -e "/dev/rtc" ]; then
( sleep 8 ; hwclock --systohc ) </dev/null >/dev/null 2>&1 &
disown
fi
# rv 0 state does not work with the new ntp versions
while [ "`ntpq -c \"rv 0 offset\" | grep \"offset=\" | awk -F \"=\" '{print $2}' | awk -F \".\" '{print $1}' | sed s/-//`" -ge 1000 ]; do
while [ "`ntpq -c 'rv 0 offset' | awk -F '=' '/offset=/ { print $2 }' | awk -F '.' '{ print $1 }' | sed s/-//`" -ge 1000 ]; do
sleep 1
done
if [ -e "/dev/rtc" ]; then
hwclock --systohc
fi
HOST_ARCH=`uname -m`
if echo $HOST_ARCH | grep "ppc64"; then
modprobe ipmi_powernv