Project

General

Profile

Actions

Bug #1347

closed

ntpd not starting

Added by Martin Klein almost 14 years ago. Updated over 13 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
03/11/2011
Due date:
% Done:

0%

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

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.

Actions #1

Updated by Chris Buechler almost 14 years ago

  • Target version set to 2.0
Actions #2

Updated by Pierre POMES over 13 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 ?

Actions #3

Updated by Jim Pingle over 13 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 over 13 years ago

  • Status changed from New to Feedback
Actions #5

Updated by Martin Klein over 13 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 over 13 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 13 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF