NTPD: Difference between revisions

From SlackWiki
Jump to navigation Jump to search
(Copy from old)
(Moved to NTPD)
Line 1: Line 1:
'''ntpd (Network Time Protocol Daemon)'''<br>
The ntpd program is an operating system daemon which sets and maintains the system time of day in synchronism with Internet standard time servers. It is a complete implementation of the Network Time Protocol (NTP) version 4, but also retains compatibility with version 3, as defined by RFC-1305, and version 1 and 2, as defined by RFC-1059 and RFC-1119, respectively.

'''Automating the time synchronization'''<br>
You have two choices for automatic time updating, you can run ntpd all the time as a background process or you can have it run once in awhile (if you are tight on system resources).
Running ntpd all the time-<br>
::Just enable rc.ntpd script:
::::<code>chmod +x /etc/rc.d/rc.ntpd</code>
::After the script is enabled you probably will want ntpd to start immediately so, can either restart the system or manually start ntpd with:
::::<code>/etc/rc.d/rc.ntpd start</code>
Running ntpd once in awhile-<br>
::You have many choices but the two best ones are:
:::1) Set up a cron job
:::2) Set up a /etc/rc.d/rc.local entry and update the time on start-up only.
::Either way, you need to add the following commands into your cron job or rc.local script:
::::<code>ntpdate -o 4 pool.ntp.org</code> <---(updates the time)
::::<code>hwclock --systohc</code> <-----------------(saves the time to the hardware clock)
'''Manually updating the time'''<br>
Issue the following commands:
::::<code>ntpdate -o 4 pool.ntp.org</code>
::::<code>hwclock --systohc</code>
'''Choosing the right time server'''<br>
On ntp.org you will find a complete list with the right time server for you.
Let's say you live in germany, then you will choose <code>de.pool.ntp.org</code>. A complete List is available at http://support.ntp.org/bin/view/Servers/NTPPoolServers
'''DST changes'''<br>
If your time is off due to DST changes, you must update the <code>/etc/localtime</code> file.  You should be able to find a correct file on the internet and just replace the old <code>/etc/localtime</code> file.
NOTE: Slackware 11 is immune to the 2007 DST changes.
'''Possible Errors & Fixes'''<br>
ERROR: "Unable to contact time server:" error with KDE time Control Module.<br>
FIX: Make sure ntpd is NOT running.  If ntpd is running, manual ntp and KDE ntp updates will return errors due to ntpd having control of the ntp port.

Revision as of 14:52, 30 August 2012