ntpd not starting
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
I found the following Processes:
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
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.
#2 Updated by Pierre POMES about 8 years ago
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 ?
#6 Updated by Jim Pingle about 8 years ago
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.