Saturday, March 7, 2009
Does Red Hat Enterprise Linux properly handle leap seconds?
Background
"Leap seconds" are extra seconds that are added or removed to keep Civil Time, which is based on Universal Coordinated Time (UTC), within 0.9 seconds of the Earth's rotational time (UT1). The last leap second was added at 2008-12-31 23:59:59 UTC. At that time, clocks keeping track of time based on UTC should have counted as follows:
2008-12-31 23:59:59 UTC
2008-12-31 23:59:60 UTC
2009-01-01 00:00:00 UTC
Note that the leap second corrections are made at midnight UTC, which is at different local times around the world. For example, the most recent leap second was added at 3:59:60 pm in the US Pacific time zone (2008-12-31 15:59:60 PST).
Red Hat Enterprise Linux using NTP
Systems running any version of Red Hat Enterprise Linux should automatically account for leap second corrections if they are using the NTP daemon to synchronize their local timekeeping with an NTP server. During the last day before a leap second correction, NTP servers should notify their clients that a leap second will occur, and at 23:59:59 UTC, the Linux kernel should add or remove an extra second by making the 60th second twice as long or removing it entirely. Thus, Red Hat Enterprise Linux systems running an NTP client during the last leap second correction should have counted time as follows:
2008-12-31 23:59:59 UTC
2008-12-31 23:59:59 UTC
2009-01-01 00:00:00 UTC
Red Hat Enterprise Linux not using NTP
By default, Linux systems not using NTP to synchronize their timekeeping will not correct leap seconds, and the time reported by these systems will have a one-second difference relative to UTC after the leap second correction. You should reset the clock manually after leap seconds occur.
You can also configure non-NTP systems to report time corrected for leap seconds by copying the appropriate file from the /usr/share/zoneinfo/right directory hierarchy to /etc/localtime and resetting the clock to the correct local time. The files in /usr/share/zoneinfo/right contain local time information corrected for all leap seconds that have occurred since the beginning of the Epoch on 1970-01-01 00:00:00 UTC. The other time zone files in /usr/share/zoneinfo do not have leap second corrections added. After the 2008 leap second, there have been 24 leap seconds added since the Epoch.
As an example, if a system is in the America/Los_Angeles (US Pacific) time zone, you can reconfigure the system to report leap-second-corrected time by running the following and resetting the clock to Pacific Time:
cp /usr/share/zoneinfo/right/America/Los_Angeles /etc/localtime
Once this is done, the system will report time corrected for leap seconds.
To ensure that the most recent leap second is accounted for properly, you should make sure you have the latest version of the tzdata installed in their Red Hat Enterprise Linux system. The leap second added at the end of 2008 should have been handled properly by the following versions of tzdata:
Red Hat Enterprise Linux Version tzdata version
==================================================
Red Hat Enterprise Linux 2.1 tzdata-2008e-1.el2_1
Red Hat Enterprise Linux 3 tzdata-2008e-1.el3
Red Hat Enterprise Linux 4 tzdata-2008e-1.el4
Red Hat Enterprise Linux 5 tzdata-2008e-1.el5
Additional Information
Additional information on leap seconds and how they are handled in Linux and by NTP can be found at the following links:
Leap Seconds
The NTP Timescale and Leap Seconds
NTP in real Life: What happens during a Leap Second?
"Leap seconds" are extra seconds that are added or removed to keep Civil Time, which is based on Universal Coordinated Time (UTC), within 0.9 seconds of the Earth's rotational time (UT1). The last leap second was added at 2008-12-31 23:59:59 UTC. At that time, clocks keeping track of time based on UTC should have counted as follows:
2008-12-31 23:59:59 UTC
2008-12-31 23:59:60 UTC
2009-01-01 00:00:00 UTC
Note that the leap second corrections are made at midnight UTC, which is at different local times around the world. For example, the most recent leap second was added at 3:59:60 pm in the US Pacific time zone (2008-12-31 15:59:60 PST).
Red Hat Enterprise Linux using NTP
Systems running any version of Red Hat Enterprise Linux should automatically account for leap second corrections if they are using the NTP daemon to synchronize their local timekeeping with an NTP server. During the last day before a leap second correction, NTP servers should notify their clients that a leap second will occur, and at 23:59:59 UTC, the Linux kernel should add or remove an extra second by making the 60th second twice as long or removing it entirely. Thus, Red Hat Enterprise Linux systems running an NTP client during the last leap second correction should have counted time as follows:
2008-12-31 23:59:59 UTC
2008-12-31 23:59:59 UTC
2009-01-01 00:00:00 UTC
Red Hat Enterprise Linux not using NTP
By default, Linux systems not using NTP to synchronize their timekeeping will not correct leap seconds, and the time reported by these systems will have a one-second difference relative to UTC after the leap second correction. You should reset the clock manually after leap seconds occur.
You can also configure non-NTP systems to report time corrected for leap seconds by copying the appropriate file from the /usr/share/zoneinfo/right directory hierarchy to /etc/localtime and resetting the clock to the correct local time. The files in /usr/share/zoneinfo/right contain local time information corrected for all leap seconds that have occurred since the beginning of the Epoch on 1970-01-01 00:00:00 UTC. The other time zone files in /usr/share/zoneinfo do not have leap second corrections added. After the 2008 leap second, there have been 24 leap seconds added since the Epoch.
As an example, if a system is in the America/Los_Angeles (US Pacific) time zone, you can reconfigure the system to report leap-second-corrected time by running the following and resetting the clock to Pacific Time:
cp /usr/share/zoneinfo/right/America/Los_Angeles /etc/localtime
Once this is done, the system will report time corrected for leap seconds.
To ensure that the most recent leap second is accounted for properly, you should make sure you have the latest version of the tzdata installed in their Red Hat Enterprise Linux system. The leap second added at the end of 2008 should have been handled properly by the following versions of tzdata:
Red Hat Enterprise Linux Version tzdata version
==================================================
Red Hat Enterprise Linux 2.1 tzdata-2008e-1.el2_1
Red Hat Enterprise Linux 3 tzdata-2008e-1.el3
Red Hat Enterprise Linux 4 tzdata-2008e-1.el4
Red Hat Enterprise Linux 5 tzdata-2008e-1.el5
Additional Information
Additional information on leap seconds and how they are handled in Linux and by NTP can be found at the following links:
Leap Seconds
The NTP Timescale and Leap Seconds
NTP in real Life: What happens during a Leap Second?
Labels:
as,
as-es-wsv.2.1,
as-es-wsv.3,
as-es-wsv.4,
leap,
ntp,
redhatenterpriselinux5,
tzdata,
workstation
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment