[HLUG] NTP nonsense

tundish tundish at thuswise.org.uk
Tue Nov 22 21:48:39 GMT 2005


Hi, it was great to meet you all last week. Looking forward to the 
Christmas meal!

I mentioned to Andrew that I was having trouble with NTP. He suggested I 
post the details here.

For those who don't know, the idea with NTP is that when your computer 
boots, it runs ``ntpdate`` which goes off and finds a server(s) on the 
internet which knows the right time, and corrects your PC's clock to 
match that time. Then, the ``ntpd`` daemon takes over and makes sure 
your clock is corrected to run the same speed as the server(s). When 
your PC has sync'ed up, it gets given a Stratum which shows its place in 
the NTP hierarchy. Then *you* can serve time to other machines, ie: the 
ones in your LAN. Stratum 1 servers totally know what the time is. 
Stratum 16 means you're pants.

I am pants. Although my server can see NTP servers, and can correct its 
time, it never seems to synch up. It stays at Stratum 16.

I'm running Gentoo, kernel 2.6.13-gentoo-r3, and ntp 4.2.0. There are a 
number of issues I've discovered which may affect NTP operation. For 
example, there's an issue with the kernel HZ value being anything other 
than 100. I've fixed that. There's an issue with using APM and ACPI, so 
I've removed them. I've checked that the ``compatibility`` module 
enables NTP running below root. I've removed the problematic keywords 
"ignore" and "noserve" from my ntp.conf. My next move will be to get rid 
of ntpd altogether and install openntp or chrony.

Hopefully, someone here might spot what I'm doing wrong. Here below is 
my ntp/conf, then a sample from ``ntpq -c pe``, then from ``ntpq -c rv``

Anyway, thanks for reading so far, and see you soon.

Cheers,

Dave.

ntp.conf::

# NOTES:
#  - you should only have to update the server line below
#  - if you start getting lines like 'restrict' and 'fudge'
#    and you didnt add them, AND you run dhcpcd on your
#    network interfaces, be sure to add '-Y -N' to the
#    dhcpcd_ethX variables in /etc/conf.d/net

# Name of the servers ntpd should sync with
# Please respect the access policy as stated by the responsible person.
#server		ntp.example.tld		iburst

server uk.pool.ntp.org prefer
server ntp.demon.co.uk
server ntp0.esat.net
server time1.mikes.fi

##
# A list of available servers can be found here:
# http://www.pool.ntp.org/
# http://www.pool.ntp.org/#use
# A good way to get servers for your machine is:
# netselect -s 3 pool.ntp.org
##

# you should not need to modify the following paths
driftfile	/var/lib/ntp/ntp.drift

#server ntplocal.example.com prefer
#server timeserver.example.org

# Warning: Using default NTP settings will leave your NTP
# server accessible to all hosts on the Internet.

# If you want to deny all machines (including your own)
# from accessing the NTP server, uncomment:
#restrict default ignore


# To deny other machines from changing the
# configuration but allow localhost:
restrict default noquery
restrict 127.0.0.1 nomodify nopeer

#restrict uk.pool.ntp.org noquery nomodify
#restrict ntp.demon.co.uk noquery nomodify
#restrict ntp0.esat.net noquery nomodify
#restrict time1.mikes.fi noquery nomodify

# To allow machines within your network to synchronize
# their clocks with your server, but ensure they are
# not allowed to configure the server or used as peers
# to synchronize against, uncomment this line.
#
#restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer notrap
restrict 192.168.0.0 mask 255.255.0.0 nomodify nopeer notrap

#fudge 127.127.1.0 stratum 10

ntp -c pe::

       remote           refid      st t when poll reach   delay   offset 
jitter
==============================================================================
  gw.roaima.co.uk 130.159.196.118  3 u  153   64   14   61.479  923.857 
  10.405
  ntp.demon.co.uk .INIT.          16 u 1853   64    0    0.000    0.000 
4000.00
  ntp0.esat.net   .GPS.            1 u  159   64   14   63.514  923.101 
   0.240
  ntp1.innofactor .INIT.          16 u  789   64    0    0.000    0.000 
4000.00

ntpq -c rv::

assID=0 status=c011 sync_alarm, sync_unspec, 1 event, event_restart,
version="ntpd 4.2.0a at 1.1190-r Thu Nov  3 20:21:32 GMT 2005 (1)"?,
processor="i686", system="Linux/2.6.13-gentoo-r3", leap=11, stratum=16,
precision=-20, rootdelay=0.000, rootdispersion=1249.335, peer=0,
refid=INIT, reftime=00000000.00000000  Thu, Feb  7 2036  6:28:16.000,
poll=6, clock=0xc72e082c.5a3161a1, state=1, offset=0.000,
frequency=0.000, noise=0.001, jitter=0.001, stability=0.000



More information about the Herefordshire mailing list