NTPD: Difference between revisions

From SlackWiki
Jump to navigation Jump to search
(Moved to NTPD)
m (Arfon moved page NTPD - temp to NTPD: Fixing page name)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:


== Automating the time synchronization ==
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 pool.ntp.org</code> <---(updates the time)
::::<code>hwclock --systohc</code> <------(saves the time to the hardware clock)
<br>
<br>
==Manually updating the time==
Issue the following commands:
::::<code>ntpdate pool.ntp.org</code>
::::<code>hwclock --systohc</code>
<br>
<br>
==Choosing the right time server==
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
<br>
<br>
==DST changes==
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.
<br>
<br>
==PROBLEMS==
'''PROBLEM:''' "Unable to contact time server:" error with KDE's 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.
[[Category:Tutorials]]

Latest revision as of 15:04, 30 August 2012

Automating the time synchronization

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

Just enable rc.ntpd script:
chmod +x /etc/rc.d/rc.ntpd
After the script is enabled you probably will want ntpd to start immediately so, can either restart the system or manually start ntpd with:
/etc/rc.d/rc.ntpd start

Running ntpd once in awhile

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:
ntpdate pool.ntp.org <---(updates the time)
hwclock --systohc <------(saves the time to the hardware clock)



Manually updating the time

Issue the following commands:

ntpdate pool.ntp.org
hwclock --systohc



Choosing the right time server

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 de.pool.ntp.org. A complete List is available at http://support.ntp.org/bin/view/Servers/NTPPoolServers

DST changes

If your time is off due to DST changes, you must update the /etc/localtime file. You should be able to find a correct file on the internet and just replace the old /etc/localtime file.

PROBLEMS

PROBLEM: "Unable to contact time server:" error with KDE's Time Control Module.
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.