UPDATE : Many of you asked for a simple process which works on all older linux systems (7.1 / 7.2 etc.) So here is a simple and easy process which is universal. Read the remaining guide for knowledge and when this is not a solution for you.:
**************************************************************************
ELEGANT / SIMPLE PROCESS to UPDATE DST 2007 on all Linux Servers :
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
*************************************************************************
Hi,
Please visit the following link I provided for practical information about the Linux DST update for a basic linux sysadmin (I mean not a fundu one...just average Admin).
http://s95078055.onlinehome.us/DST_R...7_Process.html
for your interest, I am also pasting the text below, howvwer it is a good idea if you visit the page, especially if you want to access the file links:
**********************************************************
Procedure to Update Daylight Saving Time on Red hat Linux Enterprise Server 3 (RHEL 3): - Prepared by Pratul PRATULatHOTMAILdotCOM and my Time zone is America/Los_Angeles
DISCLAIMER: These procedures and files worked fine for my systems according to my knowledge. Please use any or all of these procedures and files only at your RISK. I am providing these instructions and files to share my experience with user community and they are not intended to be used as a tested and reliable procedure or files. By using/following this document further, you are agreeing that I may not be held responsible for any damage your server and systems suffer because of these instructions or files.
As you all must know by this time that the Daylight Saving time in USA is changed. Previously it was supposes to be kicked in on Apr 1st and fall back on Oct28. However, now it is kicking in early on March11, 2007 01:59:59 AM and it will fall back late on Nov 4th 2007 01:59:59 AM.
Obviously, You must have had meetings with your boss about this and many of you must have already patched your servers. If you have RHN subscription, then it is easy to manage this patch. If you do not have one, like me, and running RHEL3, then you may follow these simple instructions to get out of this trouble much easier than your manager thought you would be. Please note that these instructions may also provide knowledge to update other Linux systems, which are not RHEL3. Please also note that this is a common knowledge that you need the new adjusted time zone files, even if you sync time with some ntp server. So do not remain in denial that since you are running ntpd, you are good.
1. First test your present servers, if miraculously they are already fixed and you do not need any updates by doing following:
# zdump -v /etc/localtime | grep 2007
Output looks like below if system is not fixed (most likely if you are reading this):
CST6CDT Sun Apr 1 07:59:59 2007 UTC = Sun Apr 1 01:59:59 2007 CST isdst=0 mtoff=-21600
CST6CDT Sun Apr 1 08:00:00 2007 UTC = Sun Apr 1 03:00:00 2007 CST isdst=0 mtoff=-18000
CST6CDT Sun Oct 28 06:59:59 2007 UTC = Sun Oct 28 01:59:59 2007 CST isdst=0 gmtoff=-18000
CST6CDT Sun Oct 28 07:00:00 2007 UTC = Sun Oct 28 01:00:00 2007 CST isdst=0 gmtoff=-21600
If you saw above, you need to take further actions to fix the time zone file to reflect the correct March and Nov settings.
However, if you are luckier than me, you may see an output like following and that will confirm that zone files are fixed and you do not need any new time zone file:
CST6CDT Sun Mar 11 07:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 CST isdst=0 gmtoff=-21600
CST6CDT Sun Mar 11 08:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 CST isdst=0 gmtoff=-18600
CST6CDT Sun Nov 4 06:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 CST isdst=0 gmtoff=-18600
CST6CDT Sun Nov 4 07:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 CST isdst=0 gmtoff=-21600
2. You need to collect some information about your Linux Server. Make an excel sheet for multiple servers and keep everything together with server names. Mine looked like following (on most servers): [by command: “cat /proc/version” ]
Linux Version: Red Hat Linux 3.2.3-42
Kernel Version: 2.4.21-20.Elsmp
GCC Version: 3.2.3 20030502
TZDATA Version: tzdata-2004b-1.EL [ by command “rpm –qa|grep tzdata”
Output of zdump checked – FIXED or Not FIXED
Date the fix will be applied:
Person who will apply the fix: mostly it is you….too bad
Theory: You need to have a fixed time zone file according to your time zone
(you know your time zone for sure by looking into “cat /etc/sysconfig/clock” file ) .
Place it at most likely directory ( may be /usr/share/zoneinfo ) then relink your /etc/localtime file to point to this fixed time zone file by issuing command like this :
“ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime”
Practical:
You have several choices to get these modified time zone files onto your system.
1A. Install the already compiled rpm (“rpm -ivh tzdata-2006m-3.el3.noarch.rpm”) I am providing. If you have a similar system as mine, Installing this rpm will bring all the updated time zone files in the directory /usr/share/zoneinfo) . Then you may simply relink that /etc/localtime to the desired time zone file as described above and test it. Testing will be again described below.
1B. Once you have this time zone file working successfully on one system, copy it over (either this particular file or whole /usr/share/zoneinfo/America directory to other systems at the same location and relink the /etc/ localtime as mentioned above. (refer : ln –sf blah blah blah)
2. If you have a system, which is different, then mine described above, or for different versions of linux, compile the RPM from the source rpm like I had to do and then repeat the 1A and possible 1B for similar systems.
A) I got source rpm from this location:
http://fr.rpmfind.net/linux/rpm2html...p?query=tzdata
I downloaded the suitable rpm according to my knowledge as tzdata-2006m-3.el3.src.rpm – 357 KB
B) rpm –ivh tzdata-2006m-3.el3.src.rpm (yes- this is source package)
This installed the source in /usr/src/redhat/SOURCES and installs the spec file in /usr/src/redhat/SPECS . (Note: your directory structures may change- so if you can not find it in above directories, then search for it using “find / -name “tzdata*”
C. Give following command “rpmbuild –bb /usr/src/redhat/SPECS/tzdata.spec”
Assuming that after completing step B, you got the tzdata.spec file created in the specified location. This compiled the source and builds a binary rpm, then placed it in /usr/src/redhat/RPMS/noarch as tzdata-2006m-3.el3.noarch.rpm
D) rpm -ivh tzdata-2006m-3.el3.noarch.rpm
This installs the binary package. Same as section 1A above. Now relink the /etc/localtime to your desired timezone by command
“ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime” and you know that Los_Angeles is my time zone and may not be your necessarily. Refer Theory section above to know about your time zone file.
Good news is that now you have a working binary rpm for your system(s) this procedure can be replicated to all desired servers.
TESTING: you already know the testing of time zone file by zdump –v /etc/localtime |grep 2007 and check the desired output. However, on non-production servers, I also did a rollover test by which I set the local data and time as [date -s "11 MAR 2007 01:59:20"]
And see what happens at next minute. It should move forward to 3 AM next minute.
Similarly, if you set the time like [date -s "04 NOV 2007 01:59:20"], next minute it should move back by 1 hour to 1 AM again.
That concludes my info on Linux DST time change. Enjoy and give me feedback at PRATULatHOTMAILdotCOM.
Download Files:
1. Save the already compiled rpm on my system by right click and “save file as” on this link: My Compiled Binary of tzdata-2006m-3.el3.noarch.rpm
2. To download the source rpm : the Link is mentioned above in section 2A as
http://fr.rpmfind.net/linux/rpm2html...p?query=tzdata
I downloaded the suitable rpm according to my knowledge as tzdata-2006m-3.el3.src.rpm – 357 KB