Wednesday, January 25, 2012

NTP Sync On Startup How To | Linux Howto | Redhat and CentOS

Tech Blog - Here is a quick howto on forcing your NTP service running on Linux Redhat and CentOS to sync during start up of the ntpd daemon, instead of doing ntpdate command is by adding -x on the option below is the howto on doing this[poiu


Go to
cd /etc/sysconfig
vi ntpd

You should see something like the below entry, take note of the 2nd line(OPTIONS)
====================
# Drop root to id 'ntp:ntp' by default.
OPTIONS=" -u ntp:ntp -p /var/run/ntpd.pid"

# Set to 'yes' to sync hw clock after successful ntpdate
SYNC_HWCLOCK=no

# Additional options for ntpdate
NTPDATE_OPTIONS=""
===================
Edit the entry by adding -x it should look like the one below now
===================
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
===================
Save the file and start ntpd by issuing /etc/init.d/ntpd start
==================
# /etc/init.d/ntpd restart
ntpd: Synchronizing with time server: [ OK ]
Starting ntpd: [ OK ]
==================

Now every time ntpd start it will attempt to synchronize with time server.


hope this helps.

1 comment:

wow error 134 said...

Nice inof, but how do i configure a NTP server? i want to do this with a client and a server.The post give me very useful information.It was exactly as you said.
wow error
134

THANKS.

For suggestion and concerns E-mail