[wellylug] NTP
Cliff Pratt
enkidu at cliffp.com
Sat Dec 17 10:15:11 NZDT 2005
David Antliff wrote:
> Cliff Pratt wrote:
>
>> David Antliff wrote:
>>
>>> I think NTP only works if your time is within about 15 minutes of
>>> correct. You often need to use ntpdate or manually set the time
>>> before starting ntpd to bring it into range. I don't think ntpd
>>> does this automatically.
>>>
>> Stop, stop, stop! ntpd is *designed* to keep the time correct! If
>> your clock drifts enough to need being set manually there is
>> something wrong, even if you shut the machine down periodically as
>> I do every night. ntpd should keep it up to date.
>
> Yes, if it's 'near-enough' correct at the time ntpd is started. Or
> can ntpd now cope with any arbitrary offset correction? There was a
> time where it would not work if the correct time and the system time
> varied by more than about 15 minutes. In another reply you said that
> ntpdate is "not necessary" and you suggest using 'date' instead. How
> exactly do you automate 'date' so that it corrects the time to a
> suitable degree for ntpd to run for a machine that has an arbitrarily
> set system clock? (Human intervention is not allowed)
>
Date is used to set the date the first time. Then ntpd keeps the clocks
in sync. You don't usually need to set the date/time on a periodic
basis. If the clock drifts ntpd should bring it back in line. I've come
across a machine where the clock jumped, but that machine had other
problems.
>
> If you haven't seen a RTC on an old PC drift much, you are either
> (un?)lucky or inexperienced. I had a machine that would drift by
> about an hour every 24 - ntpdate would run on boot, correcting the
> time (roughly) and then ntpd would take over and keep it in sync.
>
If the machine is shutdown overnight then it would lose about 30 minutes
or so, which is more than ntpd can handle. But ntpd is not designed for
that situation, where you have a machine that is shutdown for
(relatively) long periods and it is certainly not intended to cater for
wayward clocks! (Although you can set the drift if know it). However, in
the situation where you have an old machine that is shutdown every night
and you want to set the time accurately, then what's wrong with typing
'date MMDDhhmm' at boot time.
I've set up dozens, if not hundreds of machines with ntpd and never felt
the need to use 'ntpdate' for a long, long, time. But 99% of those
machines stay up 24 x 7 x 365 so ntpd does the job.
Cheers,
Cliff
More information about the wellylug
mailing list