Hi folks,

I've just built ntp (version 4.2.0a due to the gcc-4 fixes I need), and installed the bootscript from blfs-bootscripts-2005-09-10. The ntp bootscript takes anywhere between 17 seconds and 51 seconds to complete, dependent on which servers I've configured in /etc/ntp.conf. This is *not* acceptable during bootup, well not for me at least!

This command appears to have been introduced following http://www.linuxfromscratch.org/pipermail/blfs-dev/2004-October/007767.html. The initial suggestion was to use `ntpdate', but a comment was made that `ntpdate' is deprecated, hence the decision to use `ntp -gqx'.

The trouble is that `ntp -gqx' acts very differently than `ntpdate'. `ntpdate' uses a really simple "let's use the first time we get back from the first server we hit, pass it into settimeofday() and bob's your uncle, I'm finished" approach, hence completes very quickly. The NTP FAQ[1] goes into the reasoning behind why this isn't such a good idea (lack of accuracy of that one and only sample, clocks shouldn't go backwards, etc.), hence `ntp -gqx' still polls a number of servers until it's deemed reasonably safe to start the process of syncing the time using adjtimex(). This obviously takes much longer than the trivial `ntpdate' approach.

I think the solution is to move the initial time-sync operation out of the bootscript and into the configuration section of NTP (obviously with enough explanation as to why we need to do this and why it should be a one-time operation, but faulty hardware like a dodgy CMOS battery might require it to be rerun). This should avoid the problem of the clocks being too far out that ntpd refuses to sync them. It then allows `ntpd' to start up nice and quickly during the boot process as it operates in its normal gradual adjustment mode.

Regards,

Matt.

[1] http://www.ntp.org/ntpfaq/NTP-s-config.htm

PS: I found http://forums.fedoraforum.org/archive/index.php/t-11540.html particularly helpful in explaining why boot-times were so severly affected by ntpd.
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to