[ntp:questions] Re: adsl link

Per Hedeland per at hedeland.org
Sat Sep 20 10:06:52 UTC 2003

In article <mailman.13.1063723095.1857.questions at ntp.org> Brad Knowles
<brad.knowles at skynet.be> writes:
>At 4:18 PM +0200 2003/09/16, Jan Ceuleers wrote:
>>  The script does less than what restarting ntpd would do, but that is
>>  good. Restarting ntpd means that during the time that ntpd shuts down,
>>  restarts and regains synchronisation with the local clock, it does not
>>  serve time to clients.
>	You'd also lose your drift file, etc....

You certainly don't lose the drift *file*, its whole purpose is being
there across ntpd restarts (including reboots), but you do lose the
current state.

>>  - my script is only capable of refreshing the very simplest of server
>>  and peer configurations (i.e. no iburst & what have you)
>	That's easy to solve.  Instead of using awk, use grep piped to 
>sed.  That would allow you to do things like:
>		grep -i '^server' /etc/ntp.conf | grep -vi '^server 127.127' 
>| sed 's/^server/addserver/'

grep is basically a small subset of awk functionality, and awk can of
course do trivial sed operations like that one too, so this could easily
be a single awk instead of two greps and a sed. But more important is
that addserver (and addpeer) has a different and more restrictive syntax
than the config file counterpart, and allows only a subset of the config
file options - i.e. the above doesn't work in anything but "the very
simplest of server and peer configurations" either.

--Per Hedeland
per at hedeland.org

More information about the questions mailing list