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

Joseph Gwinn joegwinn at comcast.net
Fri Sep 5 16:19:45 UTC 2008

In article <BhWvk.408$yS5.253 at edtnps83>,
 Unruh <unruh-spam at physics.ubc.ca> wrote:

> Joseph Gwinn <joegwinn at comcast.net> writes:
> >In article <48bf5d9c$0$21355$c30e37c6 at pit-reader.telstra.net>,
> > "Peter J. Cherny" <peterc at luddite.com.au> wrote:
> >> Joseph Gwinn wrote:
> >> >...
> >> > Which brings me to a question:  How does one get NTP to tell you exactly 
> >> > where it is getting such things as the ntp.conf file from, all without 
> >>  >...
> >> [peterc at tantalus ~]$ strings /usr/sbin/ntpd|grep ntp.conf
> >> /etc/ntp.conf
> >In the RHEL case, this would find exactly the wrong copy of ntp.conf, 
> >being the one we were changing to no avail, not the one that NTP was in 
> >fact using.
> Which one was ntp in fact using?

Don't know yet.  Other than it wasn't the obvious one.

When we do figure it out, all pretenders to the throne will be summarily 
deleted, to prevent confusion.

> >> [peterc at tantalus ~]$ strace -f -o x /usr/sbin/ntpd -g
> >I'll have to look into this.  It sounds like it might be general enough.
> > 
> >> [root at tantalus ~]# grep ntp.conf x
> >> 3351  open("/etc/ntp.conf", O_RDONLY)   = 4
> >Doesn't this assume that the correct "ntp.conf" file is called ntp.conf?  
> >It may be common, the standard convention, but it is not required.
> >The whole point is to find the correct file without making assumptions, 
> >because on a strange computer strange things may have been done.
> yes, but then do strace as above and look through the file looking for
> something that might be a configuration file. If they call it /lib/libc.so
> then you are probably shit out of luck, but usually they will not do that. 

The strace gave a lot of data, mostly irrelevant, which I will plow 
through next week.

Joe Gwinn

More information about the questions mailing list