[ntp:questions] Finding out where ntpd gets its ntp.conf file (Joseph Gwinn)

Breck Beatie bbeatie at symmetricom.com
Thu Sep 4 14:37:46 UTC 2008

This isn't quite what you're asking for and it's certainly not ntp
specific, but one technique that I have used in the past is to replace
the binary I'm trying to "debug" with a script which dumps useful
information and then forwards the exec to the real binary.

I usually have it dump its environment and the full set of command line
arguments someplace safe and then exec the original binary.  You could
certainly have it run the original binary with strace.

I have friends who'll run the binary with gdbserver and then they
connect with gdb have their way with the binary.  I've never done that
so I have no idea how you'd invoke gdbserver.

Joe Gwinn writes:
> Which brings me to a question:  How does one get NTP to tell you
> where it is getting such things as the ntp.conf file from, all without

> being able to find or see the actual command line or lines that
> the daemon?  I did not see a ntpq command that sounded plausible, 
> although ntpq would be an obvious choice.
> This would be very useful for debugging, as each and every platform
> seems to have a different approach to handling NTP.  

More information about the questions mailing list