[ntp:questions] return value of ntpd -q

Thomas Kayser forensic at milwpc.com
Sun Dec 17 05:51:46 UTC 2006


On Wed, 2006-12-13 at 15:10 +0100, Miroslav Lichvar wrote:

First, stop ntp.  Put some log instructions in /etc/ntp.conf:

logconfig = +syncall +clockall +sysall +peerall
logfile /var/log/ntpd.log

anywhere you want to put it.  I put it near the end.  Then make the log
file /var/log/ntpd.log, and make sure ntp can write to it.  start ntpd:

ntpd -g

Wait for about 30 seconds.  Read what it does:

tail -f /var/log/ntpd.log
tail -f /var/log/syslog
dmesg | tail

You don't have to parse anything.  Everything will be straight forward
and clearly understandable.

Tom


> Hi,
> 
> I would like to ask about return code of "ntpd -q" command when
> no server can be reached. When this happen, ntpd writes to log
> "no reply; clock not set" and returns 0. Detecting the failure
> requires parsing the log and that's not very friendly. ntpdate returns
> nonzero value in such case though.
> 
> Is this intended behaviour?
> 
> Thanks,
> 




More information about the questions mailing list