Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Feb 2010 11:30:21 -0600
From:      Peter Steele <psteele@maxiscale.com>
To:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   ntpd hangs under FBSD 8
Message-ID:  <7B9397B189EB6E46A5EE7B4C8A4BB7CB385D5C73@MBX03.exg5.exghost.com>

next in thread | raw e-mail | index | archive | help
I posted this originally on the -questions list but did not make any headwa=
y. We have an application where the user can change the date/time via a GUI=
. One of the options the user has is to specify that the time is to be sync=
ed using ntp. Our coding worked fine under BSD 7 but since we've moved to B=
SD 8 we've encountered a problem where the command that we initiate from th=
e GUI:



ntpd -g -q



to perform the initial time sync is hanging indefinitely. Logs we've captur=
ed do not give any clues. This is the log from a BSD 7 system produced when=
 this ntpd command is run:



17 Feb 06:35:36 ntpd[3578]: logging to file /var/log/ntpd.log

17 Feb 06:35:36 ntpd[3578]: ntpd 4.2.0-a Sun Feb 24 09:12:07 UTC 2008 (1)

17 Feb 06:35:36 ntpd[3578]: precision =3D 1.676 usec

17 Feb 06:35:36 ntpd[3578]: kernel time sync status 2040

17 Feb 06:35:36 ntpd[3578]: frequency initialized -10.706 PPM from /var/db/=
ntpd.drift

17 Feb 06:35:45 ntpd[3578]: synchronized to 198.186.191.229, stratum=3D2

17 Feb 06:35:45 ntpd[3578]: time slew +0.003648 s



and this is the log from a BSD 8 system:



17 Feb 06:35:36 ntpd[2293]: logging to file /var/log/ntpd.log

17 Feb 06:35:36 ntpd[2293]: precision =3D 1.676 usec

17 Feb 06:35:36 ntpd[2293]: Listening on interface #0 wildcard, 0.0.0.0#123=
 Disabled

17 Feb 06:35:36 ntpd[2293]: Listening on interface #1 wildcard, ::#123 Disa=
bled

17 Feb 06:35:36 ntpd[2293]: Listening on interface #2 nic0, fe80::2a0:d1ff:=
fee3:53cc#123 Enabled

17 Feb 06:35:36 ntpd[2293]: Listening on interface #3 nic1, fe80::2a0:d1ff:=
fee3:53cd#123 Enabled

17 Feb 06:35:36 ntpd[2293]: Listening on interface #4 lo0, fe80::1#123 Enab=
led

17 Feb 06:35:36 ntpd[2293]: Listening on interface #5 lo0, ::1#123 Enabled

17 Feb 06:35:36 ntpd[2293]: Listening on interface #6 lo0, 127.0.0.1#123 En=
abled

17 Feb 06:35:36 ntpd[2293]: Listening on interface #7 lagg0, 192.168.17.46#=
123 Enabled

17 Feb 06:35:36 ntpd[2293]: Listening on routing socket on fd #29 for inter=
face updates

17 Feb 06:35:36 ntpd[2293]: kernel time sync status 2040

17 Feb 06:35:36 ntpd[2293]: frequency initialized -10.706 PPM from /var/db/=
ntpd.drift



It never gets past this last log line and we have to do a kill -9 on the nt=
pd process. The ntp.conf file we're using is



# General Configuration

server 0.us.pool.ntp.org

server 1.us.pool.ntp.org

server 2.us.pool.ntp.org

server 3.us.pool.ntp.org



# Drift file

driftfile /var/db/ntpd.drift



The versions of the two ntpd binaries are different--4.2.0-a for FBSD 7 and=
 4.2.4p5 for FBSD 8. Someone suggested that I try the command:



ntpq -pc rv localhost



But I'm not sure how to interpret the output. On a FBSD 7 system I get this=
:



     remote           refid      st t when poll reach   delay   offset  jit=
ter

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D

+169.229.70.183  169.229.128.214  3 u   40  512   37    7.921    9.170   8.=
836

*208.75.88.4     192.12.19.20     2 u   43  512   37   12.049    8.224   8.=
168

+217.160.254.116 209.51.161.238   2 u   38  512   37   55.111   -7.128  10.=
347

+198.247.173.220 128.206.12.130   3 u   39  512   37   47.401   -1.149   3.=
659

status=3Dc624 sync_alarm, sync_ntp, 2 events, event_peer/strat_chg, version=
=3D"ntpd 4.2.0-a Sun Feb 24 09:12:07 UTC 2008 (1)", processor=3D"amd64", sy=
stem=3D"FreeBSD/7.0-RELEASE-p9", leap=3D11, stratum=3D16, precision=3D-20, =
rootdelay=3D0.000, rootdispersion=3D8.340, peer=3D25349, refid=3DINIT, reft=
ime=3D00000000.00000000  Wed, Feb  6 2036 22:28:16.000, poll=3D4, clock=3Dc=
f26c2d5.ea2b4541  Wed, Feb 17 2010 11:32:37.914, state=3D1, offset=3D0.000,=
 frequency=3D-13.269, jitter=3D0.001, stability=3D0.000



and on a FBSD 8 system I get this:



     remote           refid      st t when poll reach   delay   offset  jit=
ter

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D

assID=3D0 status=3Dc011 sync_alarm, sync_unspec, 1 event, event_restart, ve=
rsion=3D"ntpd 4.2.4p5-a (1)", processor=3D"amd64", system=3D"FreeBSD/8.0-CU=
RRENT", leap=3D11, stratum=3D16, precision=3D-19, rootdelay=3D0.000, rootdi=
spersion=3D0.000, peer=3D0, refid=3DINIT,

reftime=3D00000000.00000000  Wed, Feb  6 2036 22:28:16.000, poll=3D6,

clock=3Dcf26c4d1.d21b33f1  Wed, Feb 17 2010 11:41:05.820, state=3D1, offset=
=3D0.000, frequency=3D-14.299, jitter=3D0.002, noise=3D0.002, stability=3D0=
.000, tai=3D0

169.229.70.183  .INIT.          16 u    -   64    0    0.000    0.000   0.0=
02

208.75.88.4     .INIT.          16 u    -   64    0    0.000    0.000   0.0=
02

217.160.254.116 .INIT.          16 u    -   64    0    0.000    0.000   0.0=
02

198.137.202.16  .INIT.          16 u    -   64    0    0.000    0.000   0.0=
02



In the case of the FBSD8 output, I collected this while one of these hangs =
was happening. The most obvious difference is the .INIT. entries, but there=
 also appear to be several "0.0" type of entries that look like the ntpd pr=
ocess is stuck in some kind of initialization state.



Anyone have any ideas what's going on here?







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