Bug #1347
closed
Added by Martin Klein over 13 years ago.
Updated over 13 years ago.
Description
Using 2.0rc1 built on Thu Mar 10 22:09:10 EST 2011
the ntpd service is not starting at boot time and
also not starting when i start it via status->services.
After some digging i found that the ntp port was in use
by ntpdate.
I found the following Processes:
/bin/sh /usr/local/sbin/ntpdate_sync_once.sh
ntpdate time1.progra.de time2.progra.de time3.progra.de
when i kill the shell process another one pops up
when i kill that one and the ntpdate I can start
the ntpd.
when i start /bin/sh /usr/local/sbin/ntpdate_sync_once.sh
manually after killing the processes blocking
the ntp port the script runs throug fine and starts
the ntpd at the end.
- Target version set to 2.0
The script /usr/local/sbin/ntpdate_sync_once.sh is looping until the initial synchro with ntpdate is sucessfull. Once the initial synchro is done, the script calls ntpd.
#!/bin/sh
NOTSYNCED="true"
SERVER=`cat /cf/conf/config.xml | grep timeservers | cut -d">" -f2 | cut -d"<" -f1`
while [ "$NOTSYNCED" = "true" ]; do
ntpdate $SERVER
if [ "$?" = "0" ]; then
NOTSYNCED="false"
fi
sleep 5
done
# Launch -- we have net.
killall ntpd 2>/dev/null
sleep 1
/usr/local/sbin/ntpd -s -f /var/etc/ntpd.conf
So in case of problem (dns config mispatch, wan failure, etc..), this script will never end.
A possible workaround: loop only a maximum of three times, and launch ntpd.
Chris, are you ok with this ?
If you have a WAN failure or don't have working DNS, then launching ntpd is just as useless because it uses the same time server.
This seems to be working correctly now as of edf99ce (See also 2db351a and 54c1859)
- Status changed from New to Feedback
with the Fri Apr 8 18:33:38 EDT 2011 build the
issue seems to be gone.
Thank you
I updated this again with cd11a14
ntpdate sync is completely gone, since simply starting ntpd with -s will have the same effect. This makes that separate syncing step and script obsolete.
ntpd is always running now, either as a client to keep the clock in sync (which was the case before as well) or as a server for responding to local clients.
- Status changed from Feedback to Resolved
Also available in: Atom
PDF