Re: [SLUG] ntp, xntp help

From: Ian Blenke (icblenke@nks.net)
Date: Tue Jun 01 2004 - 22:51:23 EDT


Paul M Foster wrote:

> <>
> I'm not an expert, but what I do is this: I have a central machine that
> pings the stratum 2 servers (NOT stratus 1). I just set up which time
> server to check in the /etc/ntp.conf file. Then for other machines, I
> run ntpdate once a day from a cron job to sync them all up to that
> machine. They don't really need to be more accurate than that in my
> case.
>
> My /etc/ntp.conf (on the server) looks like this (mostly):
>
> server clock1.unc.edu
>
> My /etc/cron.daily/timesync file (on client machines) looks like this:
>
> #!/bin/bash
>
> /usr/sbin/ntpdate rocky.mars.lan
> /sbin/hwclock --systohc
>
> The last line syncs the hardware clock to the OS clock.

This makes me shudder a bit. I'm sure Paul knows what he is doing though.

This method will potentially make large, drastic, time changes.
Typically, your kernel's clock will slowly drift over time; running
ntpdate will make a sudden large clock change to make your system match
an external clock source.

The beauty of running ntpd instead of ntpdate in a cron sync is that the
clock is gradually drifted over time to reach the correct time from a
higher stratum clock source. In fact, if the system clock is wildly out
of drift range (within 1000 seconds, for sanity's sake), ntpd will
refuse to change the system time altogether.

The danger here is that an external source might jump irrationally, or
potentially be intercepted and spoofed to set your system clock to an
invalid time. For business security reasons, this really isn't advised.

For a home box, this really might not be so bad.

Typically, you want to set up your own Stratum 3 server group that
"peer" with one another, and that use Stratum 2 servers as a potential
clock source. At a minimum, I suggest a Stratum 3 server that slaves
from a Stratum 2 clock source, and a group of Stratum 4 workstations
that peer with one another and/or the Stratum 3 clock source so that all
clocks drift together while still being a slave to the external Stratum
2 clock source.

If you have a GPS of any kind, you can always make your own Stratum 2
server slaved from that GPS signal. That's just fun stuff.

On system boot, ntpdate is a Good Thing. After this, ntpd really should
be used to keep the system clock in sync if at all possible.

- Ian

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:07:19 EDT