[ntp:questions] Change poll interval at runtime?

Dave Hart hart at ntp.org
Sat Feb 25 07:26:21 UTC 2012

On Sat, Feb 25, 2012 at 06:20, A C <agcarver+ntp at acarver.net> wrote:
> On 2/24/2012 21:26, A C wrote:
>> Is it possible to change the polling interval of one or more associated
>> servers at runtime? It seems like I should be able to run:
>> ntpq -c "writevar &associd hpoll=N" or is it ppoll?
> Actually, I should have been more specific and say change the minimum
> polling interval.  In other words, be able to adjust the conf file's minpoll
> flag at runtime instead of restarting.

Yes but first you have to set up a ntp.keys file and reference from
ntp.conf keys containing a symmetric key ID, type, and secret which
you'll use for runtime configuration:

in ntp.keys:

1 M mysecret # choose keyid from 1-65535, longer secret is stronger

in ntp.conf:

keys "/etc/ntp.keys"
# match key ID from ntp.keys for both
controlkey 1 # key allowed to remotely manage
trustedkey 1 # keys trusted for symmetric auth including management

Then something like the below will work:

ntpq -c "keyid 1" -c "passwd mysecret" -c ":config unpeer
server.to.change" -c ":config server server.to.change iburst minpoll

If you leave off the passwd command you'll be prompted for the secret
and can type it without displaying it.

Dave Hart

More information about the questions mailing list