How to configure the time and NTP on a Linux system
Configuring the Time and NTP on a UNAVCO Linux Field Computer
Configure time and check that ntpd is running before deploying a newly-installed Fedora system to the field. Change the system time to UTC time by issuing the following command at the command line:
If the time is not exact, get it close to the actual time by setting the approximate current time with the following command, where M=Month, D=day, h=hour, m=minutes, Y=year, s=seconds:
Syncronize the hardware clock with the system clock by issuing:
To maintain the computer’s timing, run the service ’ntpd’ in the background. To check if ntpd is running, run:
A result of :
indicates that ntpd is indeed running in the background. If you don’t see this, ntpd is not running and you will either have to activate it or install it. To check if ntp is installed you can run the following command:
A result of:
ntp-4.2.4p2-1.fc6
indicates that ntp is installed and the ntpd service just needs to be started. Before doing so, edit the file /etc/ntp.conf. This file specifies to ntpd which time server to syncronize with. For example, if UNAVCO’s timer sever is at xx.yy.zz.nn, enter the following to get ntpd to syncronize the new system’s time with the UNAVCO time server:
/etc/ntp.conf. Then, run the following command to make sure ntpd runs in the background and automatically syncronizes with UNAVCO’s time server:
Make sure that ntpd is syncronizing with the following command:
This commands give you an output of the form:
remote | refid | st | t | when | poll | reach | delay | offset | jitter |
*time-a.timefreq.bldrdoc.gov | 132.163.4.101 | 2 | u | 192 | 1024 | 377 | .659 | -0.517 | 3.265 |
+time-b.timefreq.bldrdoc.gov | 132.163.4.102 | 2 | u | 174 | 1024 | 377 | 67.478 | 11.482t | 1.770 |
LOCAL(0) | LOCAL(0) | 10 | 1 | 43 | 64 | 377 | 0.000 | 0.000t | 0.004 |
Nonzero values for the "jitter" column is a good inication that ntpd is communicating with your time servers.