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?

2
  • I see ntpdate is starting ntp service on interface up. once I put exit 0 on top of the script /etc/network/if-up.d/ntpdate everything is working as intended.
    – ntphelp
    Aug 7, 2013 at 23:15
  • I have the exact sae behaviour. Did you manage to ofind othe solution. I needed to remove the ntp to get it not boot up :D Jun 2, 2014 at 12:54

3 Answers 3

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.

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.

1
  • I followed the same steps but not working for me! I also tried by freshly installing ntpdate and ntp but same result- ntp is stating on reboot. Is there a way to find in logs who is staring ntp? I see all the ntp rc files are in kill mode after issuing update-rc.d ntp disable command!
    – ntphelp
    Aug 7, 2013 at 18:18
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.

1
  • Thanks japao. I tried this also but no use. I even set usentpconf option to NO. Nothing is helping me.
    – ntphelp
    Aug 7, 2013 at 18:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .