#daemon #linux

ntpd – don’t run late…

NTPD is a daemon that is using the NTP (Network Time Protocol) to synchronize you local watch with servers. NTPD is not changing the time after the synchronization. It calculates the difference (offset) between remote timer and the local one and after that adjusts the timer several times to minimize the offset.

Install ntpd on Gentoo/Sabayon

emerge ntp
vim /etc/ntp.conf    #change servers used for sync
vim /etc/conf.d/ntpd #set daemon options
/etc/init.d/ntpd start 
rc-update add ntpd default

More can be read on the Gentoo Forums

Install ntpd on CentOS 5,6

yum install ntp ntpdate ntp-doc
chkconfig ntpd on
ntpdate pool.ntp.org 
/etc/init.d/ntpd start
vi /etc/ntp.conf #change servers used for sync

Source ->

Immediate sync

If you want to immediately set the clock using ntpd use:

/etc/init.d/ntpd stop  # ntdp has to be stopped
ntpd -qg               # for this to work
/etc/init.d/ntpd start

The -g option allows to correct the clock even if the offset is more than 1000s. You can consider putting NTPD_OPTS="-g " in the /etc/conf.d/ntpd to make this behavior default.