You are not logged in.

#1 2008-01-01 19:23:24

ssjlegendx
Member
Registered: 2008-01-01
Posts: 94
Website

[SOLVED] NTP Startup Issue

Hello everyone,

I recently attempted to configure NTP, but I have run into some problems. When I start the NTP daemon using the following command, everything seems to work properly:

sudo /etc/rc.d/ntpd start

In this case, running ntpq lists the statistics of each of the three NTP servers that I have specified in /etc/ntp.conf.

I have attempted to start the NTP daemon at boot via two methods: by placing it in the DAEMONS section of /etc/rc.conf and by placing the command

/etc/rc.d/ntpd start

in /etc/rc.local (as recommended in the wiki). When starting the daemon through either of these methods, ntpq continues to list ".INIT." for each refid. (I realize that this is the standard output until the NTP servers have been contacted and connections have been established, but it seems that no further progress is made.)

Because I am using a laptop, I have been using a wireless internet connection, and so I am typically not yet connected when the NTP daemon starts (unless I start it manually after boot). I wonder if this has anything to do with the failure of ntpd to connect.... Any ideas?

Thanks in advance!

Last edited by ssjlegendx (2008-05-07 02:34:18)


#!/vim/rocks

Offline

#2 2008-01-02 16:06:39

ssjlegendx
Member
Registered: 2008-01-01
Posts: 94
Website

Re: [SOLVED] NTP Startup Issue

Thanks to this thread in the Ubuntu Forums, I have found a solution to my own problem. For anyone else who encounters this issue, here is the solution I used:

First, append "dynamic" to the end of each "server" line in /etc/ntp.conf. To my understanding, this tells the NTP daemon that it should use that server only when it is available -- not all the time. Each "server" line should then read:

server [address] dynamic

(where [address] is the hostname of an NTP server).

Second, replace each NTP server hostname with its IP address (which can be found using this page). This prevents the NTP daemon from having to use DNS (which might not initially be available) to resolve the IP. Finally, each "server" line should resemble the following:

server [IP] dynamic

(where [IP] is the IP address of the NTP server).

At this point, I do not think the method of startup (/etc/rc.conf or /etc/rc.local) matters; as long as the daemon is started, the above changes to the NTP configuration should correct the problem.

It should be noted that the NTP daemon still -- at least in my case -- does not connect immediately after an internet connection has been established; however, given a few minutes, ntpq reports that all servers are connected. big_smile

Last edited by ssjlegendx (2008-01-29 02:59:14)


#!/vim/rocks

Offline

Board footer

Powered by FluxBB