From nobody@FreeBSD.org  Mon Aug  6 11:11:03 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E0D5D16A477
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  6 Aug 2007 11:11:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id D2EB913C46E
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  6 Aug 2007 11:11:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l76BB3wF076444
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 6 Aug 2007 11:11:03 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id l76BB3Bl076443;
	Mon, 6 Aug 2007 11:11:03 GMT
	(envelope-from nobody)
Message-Id: <200708061111.l76BB3Bl076443@www.freebsd.org>
Date: Mon, 6 Aug 2007 11:11:03 GMT
From: "vladislav V. Prodan" <universite@ukr.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Incorrect work ntpd
X-Send-Pr-Version: www-3.0

>Number:         115242
>Category:       bin
>Synopsis:       ntpd(8): Incorrectly working ntpd on 7.0 [regression]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gavin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 06 11:20:01 GMT 2007
>Closed-Date:    Mon Jan 04 10:28:26 UTC 2010
>Last-Modified:  Mon Jan 04 10:28:26 UTC 2010
>Originator:     vladislav V. Prodan
>Release:        7.0-CURRENT
>Organization:
>Environment:
FreeBSD otrada.od.ua 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Sat Aug  4 16:03:28 EEST 2007     vlad11@otrada.local:/usr/obj/usr/src/sys/otrada.2  i386

>Description:
After several hours ntpd, it is deteriorating. At 6.2-Stable ntpd kept
clear several weeks stratum 2, and seven hours of receiving stratum 3.
We have put in cron restart ntpd every three hours.

# cat /etc/rc.conf | grep ntpd
ntpd_enable="YES"
ntpd_program="/usr/sbin/ntpd"   # path to ntpd, if you want a different one.
ntpd_config="/etc/ntp.conf"     # ntpd(8) configuration file
ntpd_sync_on_start="YES"         # Sync time on ntpd startup, even if offset is h
ntpd_flags="-p /var/run/ntpd.pid"

# cat /etc/ntp.conf

#-----<< stratum 1 >>------#
server montpelier.ilan.caltech.edu
server clock.via.net
#server ntp1.cs.mu.OZ.AU
server vega.cbk.poznan.pl
##server time.nist.gov
server time-A.timefreq.bldrdoc.gov
###server ntp3.imvp.ru
server ntp.nasa.gov

#-----<< stratum 2 >>------#
server 193.140.151.9
server 129.132.2.21
server 216.27.190.202
server ntp.colocall.net
server burka.carrier.kiev.ua
#server ntp.cis.rv.ua
server mail.nla.od.ua
server www.nla.od.ua
server apophis.onua.edu.ua


driftfile /var/run/ntp.drift
statistics peerstats
statistics loopstats
statistics clockstats
logfile /var/log/ntp.log

keys /etc/ntp.key
trustedkey 1
requestkey 1
controlkey 1
####### end ntp.conf ######

# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+ns01.deu.edu.tr 131.188.3.221    2 -  129  512  177  148.003   38.147   5.372
*swisstime.ee.et 129.132.2.22     2 -   62  512  377   65.933   23.781   2.385
 io.berkeley.net .INIT.          16 -  382 1024    0    0.000    0.000 4000.00
+212.111.205.73  132.163.4.102    2 -   71  512  377   31.124   11.602   1.407
+212.111.205.74  209.81.9.7       2 -  130  512  377   32.749    5.303   4.975

After restart ntpd:
# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
-montpelier.ilan .USNO.           1 u   53  128  377  235.554    1.071   0.939
+clock.via.net   .GPS.            1 u   95  128  377  213.797    1.419   1.118
+vega.cbk.poznan .PPS.            1 u   43  128  377   70.693    2.595   0.336
*time-B.timefreq .ACTS.           1 u   43  128  377  181.738    4.051   1.051
+ntp-nasa.arc.na .GPS.            1 u   55  128  377  225.393    5.468   0.957
-ns01.deu.edu.tr 131.188.3.221    2 u   41  128  375  139.256    7.891  18.671
-swisstime.ee.et 129.132.2.22     2 u   93  128  377   64.917    6.019   3.261
 io.berkeley.net .INIT.          16 u  880 1024    0    0.000    0.000 4000.00
-zeus.colocall.n 132.163.4.103    2 u  103  128  377   13.226  -14.406   0.972
xburka.carrier.k 195.2.64.5       2 u  107  128  377   13.232  -82.647   3.691
-212.111.205.73  192.12.19.20     2 u   95  128  377   28.439  -12.242   0.887
-212.111.205.74  212.111.205.73   3 u  103  128  377   28.958  -17.884   1.462

#ntptrace
localhost: stratum 2, offset 0.002816, root distance 0.181288
time-B.timefreq.bldrdoc.gov: stratum 1, offset 0.000000, root distance 0.001300, refid 'ACTS'

In addition, ntpd why a two processes. Maybe the inappropriateness of one
group led rapid degradation?

#ps -auxw | grep ntpd
root      35092  0,0  0,2  4624  1944  ??  Ss   12:59     0:00,14 /usr/sbin/ntpd -g -c /etc/ntp.conf -p /var/run/ntpd.pid
root      35093  0,0  0,2  4624  1952  ??  S    12:59     0:00,00 /usr/sbin/ntpd -g -c /etc/ntp.conf -p /var/run/ntpd.pid




>How-To-Repeat:
Run ntpd a couple of hours and get a result.
>Fix:
#cat /etc/crontab | grep ntpd
*       */4     *       *       *       root    /etc/rc.d/ntpd restart > /dev/null 2>&1

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: gavin 
State-Changed-When: Fri Jan 1 21:52:59 UTC 2010 
State-Changed-Why:  
To submitter: is this still an issue for you? 

Please note that it would probably be a good idea to rework your ntp.conf: 
there is little benefit in having so many servers listed in your ntp.conf, 
and also little point in having several stratum-1 and stratum-2 servers. 
Listing only (say) four local stratum-2 servers would probably provide better 
time syncronisation than listing several stratum-1 servers distributed across 
the world. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115242 
Responsible-Changed-From-To: freebsd-bugs->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Fri Jan 1 21:58:20 UTC 2010 
Responsible-Changed-Why:  
Track 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115242 

From: "Vladislav V. Prodan" <universite@ukr.net>
To: gavin@FreeBSD.org
Cc:  
Subject: Re: bin/115242: ntpd(8): Incorrectly working ntpd on 7.0	[regression]
Date: Sat, 02 Jan 2010 00:33:00 +0200

 gavin@FreeBSD.org writes:
 > Synopsis: ntpd(8): Incorrectly working ntpd on 7.0 [regression]
 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: gavin
 > State-Changed-When: Fri Jan 1 21:52:59 UTC 2010
 > State-Changed-Why: 
 > To submitter: is this still an issue for you?
 
 > Please note that it would probably be a good idea to rework your ntp.conf:
 > there is little benefit in having so many servers listed in your ntp.conf,
 > and also little point in having several stratum-1 and stratum-2 servers.
 > Listing only (say) four local stratum-2 servers would probably provide better
 > time syncronisation than listing several stratum-1 servers distributed across
 > the world.
 
 
 This server has long worked on FreeBSD 8.0.
 At FreeBSD 8.x and 9.x such problems with ntp is not observed with the
 same config file /etc/ntp.conf
 Time server from the list does not disappear.
 Although, ntp sometimes requires a restart, when the stratum falls to 3
 

From: Gavin Atkinson <gavin@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/115242: ntpd(8): Incorrectly working ntpd on 7.0
 [regression]
Date: Fri, 1 Jan 2010 22:43:07 +0000 (GMT)

 OK, thanks, I'll close the PR.
 
 The problem does seem to be related the fact that you are mixing stratum-1 
 and stratum-2 servers in the config file.  If you are syncing to a 
 stratum-2 server, your server will be classed as stratum-3.
 
 Why do you need to provide a stratum-2 server?  If this is essential, then 
 you need to remove all stratum-2 servers from your ntp.conf file, or make 
 them peers if they are servers you control.
 
 The correct answer really is to probably remove all of the stratum-1 
 servers from your ntp.conf, and use local stratum-2 servers.  Very few 
 people should ever need to have stratum-1 servers listed in their 
 ntp.conf.
 
 Gavin

From: "Vladislav V. Prodan" <universite@ukr.net>
To: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
Cc:  
Subject: Re: bin/115242: ntpd(8): Incorrectly working ntpd on 7.0 [regression]
Date: Sat, 02 Jan 2010 02:59:46 +0200

 Gavin Atkinson wrote:
 > On Sat, 2 Jan 2010, Vladislav V. Prodan wrote:
 
 >> gavin@FreeBSD.org writes:
 >>> Please note that it would probably be a good idea to rework your ntp.conf:
 >>> there is little benefit in having so many servers listed in your ntp.conf,
 >>> and also little point in having several stratum-1 and stratum-2 servers.
 >>> Listing only (say) four local stratum-2 servers would probably provide better
 >>> time syncronisation than listing several stratum-1 servers distributed across
 >>> the world.
 >> This server has long worked on FreeBSD 8.0.
 >> At FreeBSD 8.x and 9.x such problems with ntp is not observed with the
 >> same config file /etc/ntp.conf
 >> Time server from the list does not disappear.
 >> Although, ntp sometimes requires a restart, when the stratum falls to 3
 
 > OK, thanks, I'll close the PR.
 
 > The problem does seem to be related the fact that you are mixing stratum-1 
 > and stratum-2 servers in the config file.  If you are syncing to a 
 > stratum-2 server, your server will be classed as stratum-3.
 
 > Why do you need to provide a stratum-2 server?  If this is essential, then 
 > you need to remove all stratum-2 servers from your ntp.conf file, or make 
 > them peers if they are servers you control.
 
 > The correct answer really is to probably remove all of the stratum-1 
 > servers from your ntp.conf, and use local stratum-2 servers.  Very few 
 > people should ever need to have stratum-1 servers listed in their 
 > ntp.conf.
 
 > Gavin
 
 In this PR ntp server confusing derived values and deliberately remove
 the server that issued the "wrong" in his opinion values.
 
 Since some applications require ntp server not lower stratum 2, the
 configuration was deliberately stirring "authoritarian" server stratum 1
 and "fast" - stratum 2
 
 
State-Changed-From-To: feedback->closed 
State-Changed-By: gavin 
State-Changed-When: Mon Jan 4 10:28:09 UTC 2010 
State-Changed-Why:  
Submitter no longer sees this problem 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115242 
>Unformatted:
