ntpdate problem

Matthew Seaman m.seaman at infracaninophile.co.uk
Sat Mar 13 20:22:52 UTC 2010

Hash: SHA1

On 13/03/2010 19:08:38, RW wrote:
>   ntpd_sync_on_start="YES"
> is not a complete substitute for running ntpdate at startup. It allows
> ntpd to make a large correction, but it doesn't block the boot sequence
> so you could still get a large step-change later-on when your daemons
> are starting-up. 

Been there, done that and spent many hours cursing dovecot, which just
dies on its arse if the clock does anything it doesn't approve of -- the
biggest flaw in an otherwise excellent program IMHO.

> ntpd has an option to emulate ntpdate, but it holds-up the
> boot-sequence much longer - presumably this is why ntpdate has been
> deprecated for a long time but hasn't yet gone away. 

There's a trick that can be used to get round this, which is to use the
iburst option within ntp.conf.  Some NTP servers don't like having it
used against them, and will refuse to serve you, but you only need it on
one or two of the server lines in your config file.  Eg:

server   time.example.com iburst maxpoll 10
restrict time.example.com nomodify nopeer noquery notrap

(The restrict line is an example of good practice, but strictly
irrelevant to this argument.)

iburst speeds up the initial synchronisation by sending a sequence of 8
query packets at 2 second intervals, rather than the standard 64s
between packets you get otherwise.  With this in place I've never had a
problem with the clock being stepped after the rest of the system is up
and causing mayhem for other programs, nor have I needed to run
ntpdate(8) -- it even seems to work for virtual machines that can end up
missing many hours when the lappy goes to sleep.



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


More information about the freebsd-questions mailing list