Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Sep 2002 10:06:24 -0500
From:      Scott Bolte <listS+freebsd-questions@niss.com>
To:        questions@FreeBSD.ORG
Subject:   ntpd running, clock still drifting
Message-ID:  <200209201506.g8KF6O94002329@crag.niss.com>

next in thread | raw e-mail | index | archive | help
	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 majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209201506.g8KF6O94002329>