[ntp:questions] Re: ntpd, boot time, and hot plugging

Steve Kostecke kostecke at ntp.isc.org
Fri Feb 4 02:03:50 UTC 2005

On 2005-02-04, Tom Smith <smith at cag.lkg.hp.com> wrote:

> Putting ntpdate into the boot sequence means that time will be however
> long it takes for ntpdate to complete, exactly that long, and no longer
> and that when ntpdate completes the rest of your boot sequence, including
> ntpd is "safe". That's why people are unhappy about ntpdate being
> removed without an equivalent way of doing the same thing with
> ntpd:

'ntpd -gq' blocks just like ntpdate. Try it and you'll see. The
difference is that ntpd does a bit more work before it sets the clock
and 'ntpd -gq' can use NTP authentication.

> 1) step the clock to a "good enough" time
>        do this within a few seconds
>        block while doing it
>        don't touch/change the pre-computed drift while doing this

If a drift file exists ntpd uses its contents. Any updates to the drift
file are not written out until ntpd has been running for an hour.

> 2) start ntpd
> 3) start time-dependent services
> It would certainly be possible for ntpd to do this all by itself,

It is.

> but unless I misunderstand, the only way to do this with just
> ntpd at the moment is:
> 1) ntpd -gq
> 2) sleep [guess how long ntpd -gq will take, worst case, to set the clock]
>     -or-
>     spin on ps looking for ntpd to start and then end

That's not necessary because 'ntpd -gq' blocks just like ntpdate ... as
long as the init script doesn't background it.

Steve Kostecke <kostecke at ntp.isc.org>
NTP Public Services Project - http://ntp.isc.org/

More information about the questions mailing list