2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

do not set exit_code to 1 when the clock is not synced before the timeout (#4362)

This commit is contained in:
yangsong 2017-11-23 03:56:01 -06:00 committed by Bin Xu
parent ded43107e2
commit f5437609d4

View File

@ -116,11 +116,14 @@ if [ $OS_TYPE = Linux ]; then
stopservice ntpserver
fi
logger -t xcat "setting current time"
msg='syncing the clock ...'
logger -t xcat $msg
echo $msg
if ! timeout 120 ntpd -gq > /dev/null 2>&1 ; then
if ! ntpdate -t5 $master > /dev/null 2>&1; then
logger -t xcat "WARNING: NTP Sync Failed!!"
exit_code=1
msg='WARNING: NTP Sync Failed before timeout. ntp server will try to sync...'
logger -t xcat $msg
echo $msg
fi
fi