[ntp:questions] Finding out where ntpd gets its ntp.conf file
martin.burnicki at meinberg.de
Mon Sep 8 12:31:02 UTC 2008
Uwe Klein wrote:
> Martin Burnicki wrote:
>> In the current case using strace to find which files are actually opened
>> and read when ntpd starts (as proposed elsewhere) should be the best
> use strace -e trace=file ..
> to see all syscalls that use a filename string.
Unless -f is also given to strace this may not catch the correct file when
the daemon forks.
Since we want to track which files are opened by ntpd a variant of Peter J.
Cherny's proposal works nice:
strace -f -e trace=open -o x ntpd
or, to include the effects of the startup script:
strace -f -e trace=open -o x /etc/init.d/ntpd start
In both cases all open() calls can be found in the text file x. In the
latter case it may be necessary to kill ntpd afterwards from a different
console since strace does not terminate while ntpd still runs as daemon.
More information about the questions