[ntp:questions] Regarding updation of IP addresses in the ntpd.conf file

Steve Kostecke kostecke at ntp.org
Sun Jul 22 21:00:12 UTC 2012


On 2012-07-19, Arpith Nayak <arpithnayak at gmail.com> wrote:

> I want to give the user the ability to choose which NTP server his
> machine sync's with.

s/sync's/syncs/

> I'm working with a secondary processor with embedded linux which
> independently keeps time and its uses a different frequency timer than
> the timer of the host machine (assume the host machine is running
> a NTP server for me to sync with using its IP address as well). So
> there is an offset occuring in the timing as time goes by and needs
> to be periodically updated/synced.

This suggests that you don't understand how ntpd works.

ntpd (when running as a daemon) _continuously_ disciplines (e.g. adjusts
or regulates) the system (i.e. kernel) clock as long as it (ntpd) has
access to a reference source.

ntpd merely _follows_ the system clock, using the last computed
frequency correction, in cases where it (ntpd) is "synced" to the
Undisciplined Local Clock (i.e. 127.0.0.1) or is an Orphan Mode server.

> So by letting the user choose the server he wants his machine to sync
> with I'm basically giving him functionality to set his local clock
> properly in the secondary processor. (i.e. local machine time when he
> is offline, using the host machine, and the network clock when he is
> on the network.)

ntpd is designed to select the best (i.e. most likely to be correct)
time source when configured with an adequately large number of sources.

In the case where no time source is reachable (e.g. offline operation)
ntpd will be "free-wheeling" becaue it does not have a time source.

The use of the Undisciplined Local Clock or Orphan Mode on a leaf-node
system (i.e. a client-only system) is strongly discouraged because it
can lead to conditions where ntpd erroneously chases the system clock
and ignores real time servers when they become available.

If all you want to do is choose between a number of configuration files
for each mode of operation you could have your management interface
sym-link /etc/ntp.conf to the appropriate file and then restart ntpd. 

-- 
Steve Kostecke <kostecke at ntp.org>
NTP Public Services Project - http://support.ntp.org/



More information about the questions mailing list