1

Our application runs on Ubuntu 12.04 Precise. On this server, we have both ntpdate and ntp.

How to enable and disable the NTP service on-demand? I tried

# sudo update-rc.d -f ntp remove/default

and

# sudo update-rc.d ntp enable/disable 

commands, but when I reboot server the ntp service starts running!

I suspect ntpdate is starting ntp service on reboot. I removed ntpdate package from one of my experimental server, then ntp didn't start on reboot after issuing:

# update-rc.d ntp disable

Is there a way to control this? or is there way to permanently disable ntpdate?

dawud
  • 15,504
ntphelp
  • 21

3 Answers3

3

Coming in a couple years late, but hopefully it will help.

This will fix the unexpected interaction between ntpdate & ntp:

rm -f /etc/network/if-up.d/ntpdate

Then when you do a "update-rc.d ntp disable", ntp won't start on reboot.

Jim Gupta
  • 31
  • 2
1

The ntpdate command is a program that can be used to set the system time one off. There is nothing to enable or disable with ntpdate and nor does it control the ntp service.

The ntp service controls the action of the ntpd daemon. This can be disabled with the command

update-rc.d ntp disable

and then you can start and stop it using the service command

service ntp start
service ntp stop

On an Ubuntu system I have to hand with both ntp and ntpdate installed, this all works as expected. Disabling the ntp service and rebooting, the service remains off.

user9517
  • 117,122
0

You can try this solution from Disable Time Synchronization on Ubuntu:

To disable ntpdate on an Ubuntu system without removing it you could simply update /etc/default/ntpdate and add the word exit as the first line or change the NTPSERVERS variable to be empty.

dave
  • 303