ntpdate problem

Matthew Seaman m.seaman at infracaninophile.co.uk
Sat Mar 13 18:03:48 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13/03/2010 14:47:31, Антон Клесс wrote:
> I saw that more than year ago on my teacher's server, when I was deal with
> my first FreeBSD, so it's just a kind of habit.

It's a bad habit you should try and cure yourself of.  Stepping the
clock with ntpdate(8) can cause nasty effects like time apparently going
backwards -- and that will seriously upset a lot of software.

Also, it doesn't account for the natural clock drift of your system, so
it's going to give you pretty terrible accuracy -- probably good to no
more than a few seconds.  ntpdate(8) is really only intended to get the
clock into the right ballpark at system boot so that ntpd(8) has a
fighting chance of getting into synch.  The NTP project has deprecated
ntpdate(8) for some time now, and instead prefers adding an option to
ntpd(8) to say "set the clock on initial startup no matter how far out
it is."

> But on the other hand, if it exists, it could work properly, and I am
> interested in just to understand, how it should be set up.

I'm assuming you're on some sort of always-on network, like ADSL?  Most
people are nowadays.  In which case, there's really no reason not to run
ntpd(8) the way it is intended to be used.

Just add the following to /etc/rc.conf:

ntpd_enable="YES"
ntpd_sync_on_start="YES"

and run:

   /etc/rc.d/ntpd start

Wait for about 15-30 minutes, then type 'ntpq -p', and you should see a
report showing 3 servers, one of which should be marked with a '*'
indicating you're synched correctly.  That's all you need to do. You can
edit /etc/ntp.conf if you prefer to use different servers to the
automatically selected ones, or if you want to tweak any other NTP options.

Note the 'offset' field in the report.  That measures how far out your
clock is from the time sources in /milliseconds/.  Sub 10ms accuracy is
fairly easy to achieve: which is much better than you can do via
ntpdate.  Also, the NTP algorithms adapt your clock over time to run
more accurately and consequently can gradually decrease the frequency
with which the upstream time sources are polled.  Give it a day or so,
and it should max out at polling each source only once every 1024
seconds.

	Cheers,

	Matthew

- -- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkub034ACgkQ8Mjk52CukIyKFgCdGBN65guZxj8Sw3O1MSIRpPnr
fwUAnRxmOOu9SDTFGofxK36b3yQu9TkF
=9WWS
-----END PGP SIGNATURE-----


More information about the freebsd-questions mailing list