On 31/10/06 02:32, John Andersen wrote:
On Monday 30 October 2006 23:29, Darryl Gregorash wrote:
Umm, John... if /var/log/ntp exists on his system, then the daemon probably *is* already running :-)
Maybe, but does it not also log there when run via cron and at boot up?
I doubt if too many run the ntp daemon in a cron, unless it's run with the -q option; once it starts, it requires at least a kill -TERM to stop it. With the -q option, the daemon sets the time once, then exits (in which case, it makes far more sense to use ntpdate -- I doubt if that will ever be retired, no matter what the ntp documentation says). When the daemon is started from the boot script /etc/init.d/xntp, the initial output goes to syslog, as follows: Oct 19 15:23:06 static24-89-67-198 ntpdate[6770]: step time server 142.3.100.15 offset -0.491011 sec Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: ntpd 4.2.0a@1.1190-r Sat Mar 19 19:20:10 UTC 2005 (1) Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: precision = 3.000 usec Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: Listening on interface wildcard, 0.0.0.0#123 Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: Listening on interface wildcard, ::#123 Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: Listening on interface lo, 127.0.0.1#123 Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: Listening on interface eth0, 192.168.1.1#123 Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: Listening on interface eth1, 24.89.67.198#123 Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: kernel time sync status 0040 Oct 19 15:23:07 static24-89-67-198 ntpd[6775]: frequency initialized 81.206 PPM from /var/lib/ntp/drift/ntp.drift The very first line logged to /var/log/ntp is an "event_restart", as follows: 19 Oct 15:23:07 ntpd[6775]: system event 'event_restart' (0x01) status 'sync_alarm, sync_unspec, 1 event, event_unspec' (0xc010) after which everything goes to /var/log/ntp (well, this assumes use of the "logfile" directive; otherwise, the syslog facility is used). Still, the way Hylton phrased his query strongly suggests a running daemon: "... I see that the ntp daemon only checks at certain intervals..."