Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm running an older version of RH(2.4.20-28.7) and would like to install a patch for next years DST (daylight savings) any ideas where I can find it?. I can seem to find it in the RH site. Thanks
Here's a general solution (for all flavors of Linux and Unix) if you want to use the new time zone rules. (They were changed in the U.S. and Canada, but not Mexico. This means that San Diego and Tijuana will be an hour off for three weeks in the year. Go figure.)
Here is a recipe for acquiring, building, installing, and testing the
tz distribution on a GNU/Linux or similar host.
mkdir tz
cd tz
wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz'
gzip -dc tzcode*.tar.gz | tar -xf -
gzip -dc tzdata*.tar.gz | tar -xf -
Be sure to read the comments in "Makefile" and make any changes needed
to make things right for your system, especially if you are using some
platform other than GNU/Linux. Then run the following commands,
substituting your desired installation directory for "$HOME/tzdir":
make TOPDIR=$HOME/tzdir install
$HOME/tzdir/etc/zdump -v America/Los_Angeles
To use the new functions, use a "-ltz" option when compiling or linking.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800
Rep:
Quote:
Originally Posted by wjevans_7d1@yahoo.co
Here's a general solution (for all flavors of Linux and Unix) if you want to use the new time zone rules. (They were changed in the U.S. and Canada, but not Mexico. This means that San Diego and Tijuana will be an hour off for three weeks in the year. Go figure.)
Is it acceptable to merely use the new timezone source files and compile them with the existing zic already installed on the system?
Quote:
To use the new functions, use a "-ltz" option when compiling or linking.
Could you explain that a bit? Your explain didn't use that switch. Just where would one use it? (Sorry. It's early and I haven't poured enough coffee into my face yet. )
Is it acceptable to merely use the new timezone source files and compile them with the existing zic already installed on the system?
I ran the existing zic with -ltz and the timezone src file which seems to have updated things correctly. I'm wondering if I left anything out. We had to scramble a bit yesterday because we were caught napping on a couple of servers no one thought of.
date --date="MAR 25 15:00:00 UTC 2006"
date --date="MAR 25 15:00:00 UTC 2007"
Here's what I get-
/etc/localtime Sun Mar 11 06:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 EST isdst=0 gmtoff=-18000
/etc/localtime Sun Mar 11 07:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 EDT isdst=1 gmtoff=-14400
/etc/localtime Sun Nov 4 05:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 EDT isdst=1 gmtoff=-14400
/etc/localtime Sun Nov 4 06:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 EST isdst=0 gmtoff=-18000
Sat Mar 25 10:00:00 EST 2006
Sun Mar 25 11:00:00 EDT 2007
I did not update /etc/localtime separately but seems to have updated on its own as far as I can tell.
I ran
zic -l ./northamerica
and then ran timeconfig to reset the timezone.
The web applications we run which were off by an hour all day Sunday shows the correct time.
Here is the document I came up with a bit late but still
This document covers the steps required to apply the DST (daylight savings time) on a Red Hat 7.3 system
Note: This patch should cover all zones affected by the new daylight savings time correction
mkdir tz
cd tz
wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz'
gzip -dc tzcode*.tar.gz | tar -xf -
gzip -dc tzdata*.tar.gz | tar -xf -
Edit the make file and make any changes pertinent
Run the make in that directory “make TOPDIR=/usr/share/tzdir install”
Run zdump to verify your time changes “zdump –v America/Denver” to verify new time zones
America/Denver Sun Apr 2 09:00:00 2006 UTC = Sun Apr 2 03:00:00 2006 MDT isdst=1 gmtoff=-21600
America/Denver Sun Oct 29 07:59:59 2006 UTC = Sun Oct 29 01:59:59 2006 MDT isdst=1 gmtoff=-21600
America/Denver Sun Oct 29 08:00:00 2006 UTC = Sun Oct 29 01:00:00 2006 MST isdst=0 gmtoff=-25200
America/Denver Sun Mar 11 08:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 MST isdst=0 gmtoff=-25200
America/Denver Sun Mar 11 09:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 MDT isdst=1 gmtoff=-21600
America/Denver Sun Nov 4 07:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 MDT isdst=1 gmtoff=-21600
America/Denver Sun Nov 4 08:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 MST isdst=0 gmtoff=-25200
America/Denver Sun Mar 9 08:59:59 2008 UTC = Sun Mar 9 01:59:59 2008 MST isdst=0 gmtoff=-25200
America/Denver Sun Mar 9 09:00:00 2008 UTC = Sun Mar 9 03:00:00 2008 MDT isdst=1 gmtoff=-21600
America/Denver Sun Nov 2 07:59:59 2008 UTC = Sun Nov 2 01:59:59 2008 MDT isdst=1 gmtoff=-21600
Change to the directory to /usr/share/zoneinfo, here you will find a list of time zone regions. Choose the most appropriate region, if you live in Canada or the US this directory is the "Americas" directory.
If you wish, backup the previous timezone configuration by copying it to a different location. Such as `mv /etc/localtime /etc/localtime-old`.
Create a symbolic link from the appropriate time zone to /etc/localtime.
Example: ln -s /usr/share/zoneinfo/America/Denver /etc/localtime
Set the hardware clock by executing: ` /sbin/hwclock --systohc`
Test it by changing the time
In case anyone else was still confused (as I was until the lightbulb went on this morning), here are yet additional (straightforward, I think) instructions on how to make this change...
I just applied this to a Red Hat 7.2 system I'm trying to retire (yet it just keeps going)...
I did not need to change the Makefile from its defaults. Your mileage may vary. The current package at the time of this posting was tzcode2007d.tar.gz.
The steps of the process:
---begin
cd /tmp
mkdir tz
cd tz
wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz'
gzip -dc tzcode*.tar.gz | tar -xf -
gzip -dc tzdata*.tar.gz | tar -xf -
mkdir /usr/share/tzinfo
make TOPDIR=/usr/share/tzdir install
---end
The package should now be built in /usr/share/tzdir. Check for errors!
If you have none, check that the dates appear to be correct. In this case, I'm looking for my timezone, which corresponds to New_York.
Scroll through the output and look for the date changes starting in 2007.
--sample output begin
/usr/share/tzdir/etc/zoneinfo/America/New_York Sun Apr 2 06:59:59 2006 UTC = Sun Apr 2 01:59:59 2006 EST isdst=0
/usr/share/tzdir/etc/zoneinfo/America/New_York Sun Apr 2 07:00:00 2006 UTC = Sun Apr 2 03:00:00 2006 EDT isdst=1
/usr/share/tzdir/etc/zoneinfo/America/New_York Sun Oct 29 05:59:59 2006 UTC = Sun Oct 29 01:59:59 2006 EDT isdst=1
/usr/share/tzdir/etc/zoneinfo/America/New_York Sun Oct 29 06:00:00 2006 UTC = Sun Oct 29 01:00:00 2006 EST isdst=0
/usr/share/tzdir/etc/zoneinfo/America/New_York Sun Mar 11 06:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 EST isdst=0
/usr/share/tzdir/etc/zoneinfo/America/New_York Sun Mar 11 07:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 EDT isdst=1
/usr/share/tzdir/etc/zoneinfo/America/New_York Sun Nov 4 05:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 EDT isdst=1
/usr/share/tzdir/etc/zoneinfo/America/New_York Sun Nov 4 06:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 EST isdst=0
--sample output end
On my system (and probably all other "standard" EST5EDT-based RedHat 7.2 systems), /etc/localtime is a soft link to /usr/share/zoneinfo/EST5EDT. I simply deleted the soft link and created a new link to the new timezone definitions. Note the immediately changed times (with the "date" ouput).
---begin
date
rm -f /etc/localtime
ln -s /usr/share/tzdir/etc/zoneinfo/America/New_York /etc/localtime
date
---end
As cavladim indicated, it is a good idea to immediately sync the hardware clock to the (newly updated) system time.
---begin
/sbin/hwclock --systohc
---end
Your Red Hat 7.2 system should now have correct Standard/Daylight Saving transition dates.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.