LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Daylight Savings Time for 2007 (https://www.linuxquestions.org/questions/linux-server-73/daylight-savings-time-for-2007-a-518752/)

pratul 03-05-2007 05:56 PM

DST update for older versions 7.1 and 7.2 for Linux
 
Quote:

Originally Posted by Kaiyn
Does the same fix apply to RH 7.2 (before Fedora)? If not, do you know how to fix this?

Here is the process which works for 7.1 / 7.2 etc :

******************************************************
Using ZIC to compile / extracting Zone files: (Elegant / Simple process) – works well for any older Linux 7.1 /7.2 versions etc.

Download the most recent version of the time zone text files from the public domain time zone database < ftp://elsie.nci.nih.gov/pub/>, and compile the files yourself with zic.

Download the file named tzdata2007c.tar.gz

This is just an example of just making the America/Los_Angeles zone DST compiled and replace in your presently running linux system, without a break in service. Obviously you could do this for any timezone or all of them.

Download above tar file / unpack it / get your hands on the directory called

“tzdata2007c”

Logon as root
mkdir /root/DST2007 [ this directory is just a working location for my old timezone files backup. You can name anything and location can be anything ]
CD
CD DST2007
COPY / backup present timezone data files: cp –r /usr/share/zoneinfo (and later change the name as oldtimezonebackupfiles)
Unpack the tar file mentioned above and get the tzdata2007c directory. Keep one copy in your work location /root/DST2007 as backup and copy one to /tmp directory.

cd /tmp/tzdata2007c
zic –d /tmp/zoneinfo northamerica

this will compile the time zone files into a directory /tmp/zoneinfo.

Check if dates look correct by doing zdump –v /tmp/zoneinfo/America/Los_Angeles |grep 2007 . [ Note :you see March 11th and Nov 4th ] .

cd /usr/share
rm –rf zoneinfo
mv /tmp/zoneinfo .

cd /etc
ln –sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
check again the correct dates by zdump –v /etc/localtime |grep 2007

***************************************************************

dougwo 03-09-2007 09:04 AM

Ugh!
 
I have one server that is FC 3 and other that is FC 4. Both have the required tzdata (2005m-1) or greater on them. Yet both are still reporting the old daylight savings time. What should I do? I re-updated the packages and restarted the machines. No luck.

MensaWater 03-09-2007 09:11 AM

tzdata updates the zonefiles but NOT /etc/localtime. You need to copy (or link) /etc/localtime to the zone you want.

e.g. cp -p /usr/share/zoneinfo/America/New_York /etc/localtime if you want to use Eastern time for the US (or /usr/share/zoneinfo/EST5EDT).

Then type "zdump -v /etc/localtime |grep 2007" to verify it has what you expect.

bic 03-09-2007 12:17 PM

ugh, we found a Redhat 6 box with Oracle 8 on it.

Appears that zdump isn't available, is there something equivalent waaay back then?

bic 03-09-2007 12:27 PM

Quote:

Originally Posted by bic
ugh, we found a Redhat 6 box with Oracle 8 on it.

Appears that zdump isn't available, is there something equivalent waaay back then?

well, copying it from a RH 9 system seems to work ok.

MensaWater 03-09-2007 04:40 PM

Copying the zdump binary or the zone file or both?

bic 03-10-2007 07:39 AM

Quote:

Originally Posted by jlightner
Copying the zdump binary or the zone file or both?

just the binary.

the compile works, but it still used the old time zones.

we ended up saying forget it, something along the lines of the system is soo old but critical enough it's not worth it to try to fix and possibly break it. Then we'd have another big problem.

MensaWater 03-10-2007 10:26 AM

Does 6 have an /etc/localtime?

If so did you copy the compiled file over /etc/localtime then run:
zdump -v /etc/localtime |grep 2007 ?

rch1231 03-10-2007 11:29 AM

If it helps I put together a shell script to do all of the parts for you. I needed to update 30 servers and wanted a quick way.

wget txlinux.com/tzupddate.sh

then run it with

sh ./tzupdate.sh

rch1231 03-10-2007 12:18 PM

A script based on the posting here that fixes the issue for CentOS and redhat 7 or 8 and Fedora Core. Help your selves. I had 30 servers to update.

#!/bin/bash
echo "This script is provided at no charge and does not in any way guarantee the files will install"
echo "or that the update will work. The user is free to run the script or to simply look at the script"
echo "decide for them selves what needs to be done. The script is based on information from the following"
echo "posting on the internet:"
echo "http://www.linuxquestions.org/questions/showthread.php?t=527036"
echo "run at your own risk."
echo "If the date below is in Standard time (ie CST) continue."
echo "If it is in Daylight time (ie CDT) exit program"
date -d '27 March'
echo "<CTRL> C to Break <ENTER> to Continue"
read akey
mkdir /root/tz
cd /root/tz
echo " "
if [ ! -e "/bin/ksh" ] ;
then
ln -s /bin/bash /bin/ksh
fi
if [ ! -e "/bin/nawk" ] ;
then
ln -s /bin/awk /bin/nawk
fi
wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz'
tar xvzf /root/tz/tzcode2007c.tar.gz
tar xvzf /root/tz/tzdata2007c.tar.gz
pwd
echo "Compiling files needed for update. Press <ENTER> to continue"
read akey
make install
echo " "
echo "**************"
echo "Second check. If date is March 11, 2007 QUIT if April 1, 2007 continue"
zdump -v America/Chicago | grep 2007
echo "<CTRL> C to Break <ENTER> to Continue"
read akey
./tzselect
mkdir /tmp/zoneinfo
cd /tmp/zoneinfo
tar xvzf /root/tz/tzdata2007c.tar.gz
echo "Creating temporary zone files"
/root/tz/zic -d /tmp/zoneinfo northamerica
cd /usr/share/
mv zoneinfo zoneinfo.old
mv /tmp/zoneinfo .
rm /etc/localtime
ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime
echo "Check to see if update took. Should now read March 11 2007"
zdump -v America/Chicago | grep 2007
echo " "
echo "If the date below is CDT it worked and you are done. If it is in CST the update did not work."
date -d '27 March'

pratul 03-10-2007 01:29 PM

jlightner : Do you have zic on those old machine
 
I suggest compiling zone files manually and then place it on old servers in /usr/share/zoneinfo and relink the /etc/localtime.

I have seen that for old versions of linux (6/7/9), my process defined earlier using "zic" works better and it is simple than thinking about updating zdata package/RPM etc.






Quote:

Originally Posted by jlightner
Does 6 have an /etc/localtime?

If so did you copy the compiled file over /etc/localtime then run:
zdump -v /etc/localtime |grep 2007 ?


MensaWater 03-10-2007 04:18 PM

The oldest Linux I had was RedHat 7.3 (in Linux). The compile and link (actually copy) is what I did. I did the copy because the existing /etc/localtime was a copy rather than a link (typically a copy of /usr/share/zoneinfo/America/New_York because I'm in the Easter timezone).

For some odd reasons EST5EDT is NOT the same as America/New_York for the new bundle but was back in 7.3.

My question to the poster was asking if he had remembered to put in a new /etc/localtime (link or copy) when he had done the zone file.

When I said "compile" I of course meant "zic" (zone info compile).

However I don't have RH 6 so I asked if /etc/localtime existed then because I don't know. While /etc/localtime also exists on my FreeBSD UNIX systems it does NOT exist on HP-UX or SCO UNIX so there is a different fix for those. It therefore seems possible to me that early Linux may have done it differently.

Interestingly though - why not just go ahead and zic all the files that come in the bundle to update all zone files? I wrote a script once when I was supporting sites in multiple countries where I relied on zone files for those countries - not just /etc/localtime. If anyone really is afraid the zone files may be needed later they could just save all of /usr/share/zoneinfo before the compiles.
tar cvf zoneinfo.pre2007.tar /usr/share/zoneinfo

findanisp 03-11-2007 12:45 AM

It's a bit late to ask this - but does changing the time zone files require rebooting the computer to pick up the change?

I guess I'll find out in 15 minutes...

MensaWater 03-11-2007 03:14 AM

Rebooting isn't mandatory but a good idea. Some processes may get their timezone information on start and not check again. By rebooting you insure all processes are using the new timezone info.

MensaWater 03-11-2007 03:18 AM

The World Didn't End
 
Amazing all of my UNIX/Linux systems successfully transitioned to the new EDT without a problem AND my lights and cable are still on.
Hell even my unsupported SCO (I know) UNIX box’ bizarre fix for unsupported version worked as did my unsupported HP-UX 10.20 servers.

If only I could have figured out how to automatically change the dam AS400 times I wouldn’t have even had to have gotten up tonight.

Interesting that the media waited so long to start hyping on the potential for issues. I'm sure they'll do as they did after Y2K and complain about how the IT industry led them astray when the world didn't end and ignored the amount of effort that went into insuring everything was compliant ahead of time. Not that I knew anyone in IT who even bothered to stockpile food and water like the nuts were doing. Ah well I guess now they can go back to the Anna Nicole Smith story - apparently she's still dead. :rolleyes:


All times are GMT -5. The time now is 01:33 PM.