:: Re: [DNG] ntp setup
Etusivu
Poista viesti
Vastaa
Lähettäjä: Alessandro Vesely
Päiväys:  
Vastaanottaja: dng
Aihe: Re: [DNG] ntp setup
On Mon 21/Jun/2021 00:52:42 +0200 karl wrote:
> Rick Moen:
> ...
>> https://support.ntp.org/bin/view/Dev/DeprecatingNtpdate
> ...
>
> Thanks for the link.



And for the heads-up.

I've been using ntpdate-debian every 30 minutes for years. After tuning the HW
clock, the adjustment is usually less than 20 milliseconds. More than enough
for my needs, and preferable to the resources consumed by a full-fledged ntpd.

Switching to sntp seems to be an easy task. However, there is no "sntp-debian"
available. I could read NTPSERVERS from /etc/default/ntpdate and use them with
sntp, or just use pool.ntp.org. (sntp doesn't compare responses, just uses the
first it receives.)

With respect to ntpdate, sntp has separate options to enable slew or step mode,
and max offset for slew. Thus, one can enable slew only and set a reasonable
number of milliseconds, so that sntp won't update the system time if it gets an
unreasonable response from a runaway remote server. However, the logged line
(on user.log) and the exit code don't say whether the system time was changed
or not. Perhaps should cron something like so:

     sntp -M 128 -s pool.ntp.org|\
     (
         read first_line_not_used
         read date time utc offset rest
         case $offset in
             ([+-]0.00*):;;
             (*) logger -t sntp -p user.crit "Time offset: $offset";;
         esac
     )




Best
Ale
--