[ntp:questions] Handle ntp conf modification when ntp is already running

Rob nomail at example.com
Wed Apr 9 16:04:46 UTC 2014

David Lord <snews at lordynet.org> wrote:
> Arthur Lambert wrote:
>> Hi,
>> Thank you for all your answer.
>> So in fact Jochen, even if I need for some reason to handle dynamic
>> change on ntp.conf, you are telling me that it is cleaner and better
>> to restart the daemon ?
>> I am currently putting some modification in my ntp conf file thanks to
>> tr69 protocols. Moreover due to security constraints it is very hard
>> for me to restart the ntp daemon.. It is quite strange that noone try
>> to patch ntp daemon to handle runtime modification on ntp conf.
>> I also tried to use confi-from-file feature from ntpq without success.
>> I add a ntp url in my ntp conf and run ntpq -c config-from-file
>> /etc/ntp.conf. Then I am not able to see my new ntp url by running
>> ntpq -p command.
> Hi
> I've just tried adding an extra server using config-from-file
> (ntp-dev-4.2.7p439 NetBSD-6)
> ntpq>
> config-from-file ntp.conf_add.2014040901
> Sending configurstion file, one line at a time.
> Keyid: 1
> MD5 Password:
> Line No: 1 Config Succeeded: server -4 xxx.xxxxx.xx.xx minpoll 8 maxpoll 
> 10 iburst
> Done sending file
> ntpq> quit
> ntpq -p shows the added server
>   remote          refid         st t    poll reach  delay offset jitter
> +xxx.xxxxx.xx.xx xxxxxxxxxxxxx  2 u 193 256     7 22.334  2.349  0.113
> David

Indeed it can be done that way.

For Arthur: you need to modify the ntp.conf in case the system is
rebooted outside your control (it will then use the values from ntp.conf)
and at the same time use the above method to add the new server
Then you do not need to restart ntpd and you can still change the config.

OF COURSE ntpd should simply listen for SIGHUP and when it is received
re-read the config file.  Like almost all Unix daemons do.

However, you will have a hard time convincing the group here, as you
already found out.

More information about the questions mailing list