Ubuntu – enable/disable ntp service on ubuntu 12.04

ntpntpdntpdateUbuntuubuntu-12.04

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?

Best Answer

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.

Related Topic