SPAM-LOW: Re: Spring Ahead

Chuck Rhode CRhode at LacusVeris.com
Fri Feb 2 13:51:52 PST 2007


Thanks, guys, for pointing out *glibc*.

I've taken a quick look, and I don't believe one needs to build it
merely to update timezones.  Please tell me what you think of this:

These instructions make assumptions about where things are located
based on the LFS 5.0 Book.  They are a stepwise approach to fixing
time-zone information to comply with new daylight-saving time (DST)
begin/end dates mandated this year (2007) by the United States
Congress in 2005.  Those not affected by any of this (You know who you
are, Canucks not excepted.) can ignore what follows.

======
Step A
======

What time zone do you *think* you're in?  Run this quiz to find out:

tzselect

This prints the name of the time-zone information file relevant to
your location.  This is a binary file containing coded data.

======
Step B
======

Have you set the TZ environment variable?

echo $TZ

This prints the name of your configured time zone.  It must be
identical to the result from Step A.  If not, thou shalt not go on to
Step C.  Stop now!

======
Step C
======

Do you have the same localtime file installed that you think you do?

cmp /etc/localtime /usr/share/zoneinfo/$TZ

If these two files compare equal (no difference reported), go on to
Step D; otherwise, thou hast screwed something up and thou shouldst
not.

======
Step D
======

Are you already compliant?

zdump -v -c 2008 $TZ | tail -6 | head -4

This should print out the dates of the 2007 vernal and autumnal time changes.  

If they are in March and November, all is well.  You have
up-to-date time-zone info on your system, and there is absolutely no
need for you to follow any further with this.  Stop now!

If they are in April and October, you are at risk of being an hour
late after the middle of March, according to Congress.  Pursue
legality by following on to Step E.

======
Step E
======

Can you recreate this localtime file (just in case)?  

Untar your old *glibc*.

cd /usr/src
tar -zxvf glibc-2.3.2.tar.gz
cd glibc-2.3.2/timezone
zic -d /tmp/timezone northamerica
cmp /etc/localtime /tmp/timezone/$TZ

Thou shalt go on to Step F if, and only if, these two files compare
equal (no difference reported); otherwise, you can't get back here if
you need to.

======
Step F
======

Can you create something completely different?

Download and untar a new *glibc*.

rm -rf /tmp/timezone
cd /usr/src
tar -zxvf glibc-2.3.6.tar.gz
cd glibc-2.3.6/timezone
zic -d /tmp/timezone northamerica
cmp /etc/localtime /tmp/timezone/$TZ

Thou shalt go on to Step G if, and only if, these two files compare
different; otherwise, there's no point to this exercise.

======
Step G
======

cd /usr/share/zoneinfo
mkdir bak
cp -a {America,Atlantic,Pacific} bak/
cd /usr/src/glibc-2.3.6/timezone
zic -d /usr/share/zoneinfo northamerica
cp -a /usr/share/zoneinfo/$TZ /etc/localtime

At this point it's too late to go back, except that you might be able
to restore the files in the /usr/share/zoneinfo/bak directory to their
rightful place (or recompile the time-zone info from the old *glibc*)
and then make a yet another copy of /etc/localtime.

Go back to Step D to check the final configuration for compliance.

-- 
.. Chuck Rhode, Sheboygan, WI, USA
.. Weather:  http://LacusVeris.com/WX
.. 8° — Wind W 21 mph




More information about the lfs-support mailing list