Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 '13 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 –  mirkobrankovic Jun 2 at 12:54

2 Answers 2

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.

share|improve this answer
    
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 '13 at 18:18

You can try this solution: "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." - source: Disable Time Synchronization on Ubuntu

share|improve this answer
    
Thanks japao. I tried this also but no use. I even set usentpconf option to NO. Nothing is helping me. –  ntphelp Aug 7 '13 at 18:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.