IBM Support

Synchronizing hardware clock with system time when using NTP

Question & Answer


Question

How can I keep the hardware clock synchronized with system time when NTP is being used?

Answer

The /etc/sysconfig/ntpd file contains the SYNC_HW CLOCK setting which determines if the hardware clock updates every time NTP synchronizes the system time. By default, the setting is off as shown below:

SYNC_HWCLOCK=no

To have the hardware clock updated every time NTP successfully synchronizes the system time with a time server, modify the line to read as follows:
SYNC_HWCLOCK=yes


In addition, you may also want to update the clock every time the NTP daemon service is started.  To do this, edit the /etc/sysconfig/ntpd file and modify the OPTIONS line.

It will look similar to the following:


OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"

 Add ' -x ' to the end of this parameter so that it reads as follows:


OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -x" 


The next time you restart the NTP daemon, you will see the following:
# service ntpd restart 
Shutting down ntpd:                                          [  OK  ]

 

ntpd: Synchronizing with time server:             [  OK  ]

 


Syncing hardware clock to system time          [  OK  ]
Starting ntpd:                                                       [  OK  ]


You can confirm the two times are in synch with the following command:
hwclock --show ; date

Note that in the sample output, the first line of output is the hardware clock's current time and the second line is the system's current time:
[root]# hwclock --show ; date
Fri 02 Oct 2009 01:37:20 AM EDT  -0.664685 seconds
Fri Oct  2 01:37:19 EDT 2009
[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ025708

Document Information

More support for:
IBM PureData System

Software version:
1.0.0

Document number:
464665

Modified date:
17 October 2019

UID

swg21572558