Manually Updating tzdata on RHEL3

Redhat LogoThe new US Daylight Savings Time (DST) settings will take effect about now … 1:59 am on March 11 PST.

For those not updating their timezone settings with the RedHat up2date -u tzdata command for various reasons, here’s a manual way of doing it using rpm commands.

For RHEL3, find and download the file tzdata-2007c-1.el3.src.rpm, login as root, stop database replication on the master then all slaves if applicable, then:

rpm -i tzdata-2007c-1.el3.src.rpm
cd /usr/src/redhat/SPECS
more tzdata.spec
rpmbuild -ba tzdata.spec
cd /usr/src/redhat/RPMS/noarch
rpm -Uvh tzdata-2007c-1.el3.noarch.rpm
ls -l /usr/share/zoneinfo/America/Los_Angeles
cp -p /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
zdump -v /etc/localtime | grep 2007
sync;sync;sync
sleep 3
reboot

Success is indicated by each command succeeding, and zdump showing a bunch of dates for March and none for April:

# zdump -v /etc/localtime | grep 2007
/etc/localtime Sun Mar 11 09:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 PST
/etc/localtime Sun Mar 11 10:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 PDT
/etc/localtime Sun Nov 4 08:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 PDT
/etc/localtime Sun Nov 4 09:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 PST

To test that the tzdata update is working for MySQL, this command should result in same output for both time stamps:

SELECT UNIX_TIMESTAMP('2007-03-11 02:00:00'),
UNIX_TIMESTAMP('2007-03-11 03:00:00');

The reason replication needs to be stopped is to avoid transmitting differing timestamps to the slaves. sync and sleep are to give broken software like MySQL a chance to attempt to flush to disk before getting a TERM signal from reboot. (MySQL often does not shut down cleanly, resulting in database corruption.)

The reboot is needed to ensure applications are not caching old time and timezone values.

Resources

How to verify .rpm files vs. installation?
Re: Other than –rebuild, how do I use an SRPM file?
Using RPM
Redhat Network: tzdata enhancement data
Redhat KB 9950: What do I need to do for 2006 and 2007 Timezone changes …

This entry was posted in Linux, Open Source, Tech. Bookmark the permalink.

Comments are closed.