NTP force update


A NEW TECHNIQUE TO SOLVE/DISABLE NTP RELATED ISSUES (IT WILL DEFINITELY STOP NTPD SERVICE)

If you’ve ever had a system drift pretty wide on the time, you are aware that ntp can’t update the time after a certain amount of drift. I’ve found this to be a particular problem on some systems from a reboot, where the time never gets manually set and so it stays off kilter and just keeps drifting more and more.

On “Redhat” flavor boxes, you can edit

/etc/sysconfig/ntp

and change

OPTIONS=”-u ntp:ntp -p /var/run/ntpd.pid”

to be

OPTIONS=”-x -u ntp:ntp -p /var/run/ntpd.pid”

That -x is a very tiny change, but a huge effect. What this does is when you stop/start ntp (or it starts on a reboot of your system), it does the equivelent of

ntpdate -u time.server.of.choice

ie, forcing the manual update against your chosen time server. No more manually fixing drift that has gotten too wide. From a reboot the time is set to a value that ntp then can automatically update and keep updated moving forward.

Try running

service ntpd restart

and you’ll see it do the manual time update.

# service ntpd restart
Shutting down ntpd: [ OK ]
ntpd: Synchronizing with time server: [ OK ]
Syncing hardware clock to system time [ OK ]
Starting ntpd: [ OK ]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s