Re: ntpd running, clock still drifting

2002-09-20 Thread Oliver Fromme

Scott Bolte [EMAIL PROTECTED] wrote:
  I recently switched from running ntpdate via cron to ntpd.
  While ntpd starts and runs, the clock drifts badly (over 6
  seconds) in just a few hours. It looks to me like ntpd is
  not doing anything.

Two hints:

First, add this line restrict 127.0.0.1 to your ntp.conf.
It is required so that ntpd can access its own clock on the
local machine.

Second, when the ntpd process has run for a few minutes,
type ntpq -p.  The output is very useful to diagnose
problems.  It contains compact information about all known
servers, including connectivity, stratum and delay.

Another command that I use sometimes to debug NTP problems
is ntpdc -c monlist.

Regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH  Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

All that we see or seem is just a dream within a dream (E. A. Poe)

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



ntpd running, clock still drifting

2002-09-20 Thread Scott Bolte

I recently switched from running ntpdate via cron to ntpd.
While ntpd starts and runs, the clock drifts badly (over 6
seconds) in just a few hours. It looks to me like ntpd is
not doing anything.

Summary of what I have:

+ I'm using 4 publicly available stratum 2 servers.

+ I have a drift file, which consistently says '0.000'.

+ I'm trying to gather statistics but nothing is ever
  written to the files (which I touched by hand).

+ I've followed the ntp hints for freebsd and ensured my
  kernel has POSIX scheduling calls.

+ I've tried running ntpd with one or more -d options and
  allowed it to run for nearly a day. In that case, and when
  I allow it to run in the background, I never see a message
  that it is setting the clock.

+ I am running FreeBSD 4.6-RELEASE.

+ ntpdate does work, so I doubt there are any network/firewall
  issues.

In the 55 minutes since I rebooted with a kernel with
_KPOSIX_VERSION=199309L the clock has drifted -.48 seconds.

Any help would be appreciated. Details included below.

Thank you,

Scott


- Detailed information ---

crag% cat /etc/ntp.conf
#
# FreeBSD NTP help:
#   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ntp.html
#   file://localhost/usr/share/doc/ntp/index.htm
#
# Server list from http://www.eecis.udel.edu/~mills/ntp/servers.htm
#  and http://www.eecis.udel.edu/~mills/ntp/clock2.htm
#
server ntp3.cs.wisc.edu prefer
server ntp-2.cso.uiuc.edu
server ntp1.cs.wisc.edu
server ntp-1.cso.uiuc.edu

driftfile  /var/db/ntp.drift

statistics clockstats peerstats loopstats
statsdir   /var/log/ntpstats/
filegen peerstats  file peerstats type day enable
filegen loopstats  file loopstats type day enable
filegen clockstats file clockstats type day enable

restrict default ignore
# IP address sanitized
restrict X.X.X.X mask 255.255.255.0 notrust nomodify notrap



crag% grep ntp /etc/rc.conf 
ntpdate_enable=YES
ntpdate_flags=-b ntp3.cs.wisc.edu ntp-2.cso.uiuc.edu ntp1.cs.wisc.edu
xntpd_enable=YES



crag% cat /var/db/ntp.drift 
0.000



crag% ls -l /var/log/ntpstats/
total 0
-rw-r--r--  1 root  wheel  0 Sep 19 18:04 clockstats
-rw-r--r--  1 root  wheel  0 Sep 19 18:04 loopstats
-rw-r--r--  1 root  wheel  0 Sep 19 18:04 peerstats



crag% cat /usr/src/contrib/ntp/html/hints/freebsd
If you are compiling under FreeBSD and see messages in the syslogs that
indicate that the ntpd process is trying to use unavailable sched_
calls, it means you are running a kernel that does not have the POSIX
scheduling calls enabled.

You have two choices:

- Ignore the messages

- Generate a new kernel, where the kernel configuration file contains
  the lines:

  options   P1003_1B
  options   _KPOSIX_PRIORITY_SCHEDULING
  options   _KPOSIX_VERSION=199309L



crag% strings /kernel | egrep '^___' | egrep '_KPOSIX|P10'
___options  P1003_1B#Posix P1003_1B real-time extensions
___options  _KPOSIX_PRIORITY_SCHEDULING
___options  _KPOSIX_VERSION=199309L # needed by ntpd?



crag% tail /var/log/messages | grep ntp
Sep 20 09:05:03 crag ntpd[125]: ntpd 4.1.0-a Tue Jun 11 03:57:50 GMT 2002 (1)
Sep 20 09:05:03 crag ntpd[125]: kernel time discipline status 2040



crag% uptime
 9:59AM  up 55 mins, 8 users, load averages: 0.00, 0.00, 0.00
crag% ntpdate -d ntp3.cs.wisc.edu ntp-2.cso.uiuc.edu ntp1.cs.wisc.edu | tail -1
20 Sep 09:59:28 ntpdate[2191]: adjust time server 128.105.39.11 offset -0.477759 sec


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message