Bug #1347


ntpd not starting

Added by Martin Klein almost 11 years ago. Updated over 10 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
Affected Architecture:


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/

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/
manually after killing the processes blocking
the ntp port the script runs throug fine and starts
the ntpd at the end.

Actions #1

Updated by Chris Buechler almost 11 years ago

  • Target version set to 2.0
Actions #2

Updated by Pierre POMES almost 11 years ago

The script /usr/local/sbin/ is looping until the initial synchro with ntpdate is sucessfull. Once the initial synchro is done, the script calls ntpd.


SERVER=`cat /cf/conf/config.xml | grep timeservers | cut -d">" -f2 | cut -d"<" -f1`

while [ "$NOTSYNCED" = "true" ]; do
        ntpdate $SERVER
        if [ "$?" = "0" ]; then
        sleep 5

# 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 ?

Actions #3

Updated by Jim Pingle almost 11 years ago

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)

Actions #4

Updated by Jim Pingle almost 11 years ago

  • Status changed from New to Feedback
Actions #5

Updated by Martin Klein almost 11 years ago

with the Fri Apr 8 18:33:38 EDT 2011 build the
issue seems to be gone.

Thank you

Actions #6

Updated by Jim Pingle almost 11 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.

Actions #7

Updated by Chris Buechler over 10 years ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF