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

Uwe Klein uwe_klein_habertwedt at t-online.de
Mon Sep 8 13:09:56 UTC 2008

Martin Burnicki wrote:
> 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

yes you need "-f" too, see my other post.

But use trace=file ( and equivalent to trace=open,stat,chmod,unlink,... )

"file" is a basket for all fileops with a string arg ( stat(), open() unlink() ...
That way you not only see the files opened but often more interesting the
places that are searched for certain files.


More information about the questions mailing list