[ntp:questions] Finding out where ntpd gets its ntp.conf file

Joseph Gwinn joegwinn at comcast.net
Fri Sep 12 14:01:13 UTC 2008


In article <cudyk.1771$1x6.1012 at edtnps82>,
 Bill Unruh <unruh at physics.ubc.ca> wrote:

> Joseph Gwinn <joegwinn at comcast.net> writes:
> 
> >In article <a6WdnXY1gfe4FVXVnZ2dnUVZ_gudnZ2d at megapath.net>,
> > hal-usenet at ip-64-139-1-69.sjc.megapath.net (Hal Murray) wrote:
> 
> >> >I'm not a sysadmin, but am digging into service.  I don't recall that 
> >> >the service man page was that helpful, but will look again.
> >> 
> >> service is mostly a shortcut to save typing.  If you think it is getting
> >> in your way, run /etc/init.d/ntpd <whatever> by hand.  (It also
> >> fixes up environment and cd-ed directory and whatever.)
> 
> >Yes.  This is what we did to prove that NTP really could generate 
> >loopstats and peerstats.
> 
> No I suspect you ran /usr/sbin/ntpd, not /etc/init.d/ntpd
> /etc/init.d/ntpd start should do EXACTLY the same thing as when the system
> runs it on bootup.

If I recall, the line that worked was "/etc/init.d/ntpd -c <filename of 
our ntp.conf file>".  I don't recall that sbin was involved.


> >> The -x command to bash will print each line as it gets expanded
> >> and executed.  So you might try something like:
> >>   bash -x /etc/init.d/ntpd start
> >> to see what is really going on.
> 
> >Another good idea to try.
> 
> It of course produces far more output but obviates the need to insert echo
> lines into /etc/init.d/ntpd

Yep.  But if it solves the problem, I won't mind the blather.


> Note, I am wondering what has happened to all these suggestions? Have
> you tried any of them yet? Have you discovered what it is actually using as
> its configuration file?

I have been collecting all the suggestions I have heard here, and will 
try them when the relevant sysadmin is able to spare the time.  This may 
be today (Friday).  Unless he is somehow deflected.


> You might want to post the config file here (ntp.conf) here in case it is
> some error in that file which is causing your problems rather than that
> ntpd is using some other config file. 

We are happily collecting loopstats and peerstats data on RHEL using 
that ntp.conf file, once we started the daemon manually with an explicit 
filepath argument (as described above), so the ntp.conf file itself does 
not appear to be the problem.  I was suspicious of that file too, and so 
had cleaned it down to something like three lines, basically following 
the minimum ntp.conf example given in the online NTP documentation.


By the way, I doubt that it matters here, but this RHEL is running NTPv4.


Joe Gwinn




More information about the questions mailing list