WST DST Timezone Changes for *nix

With the 3rd quickly approaching, I've been getting a little worried about the daylight savings changes for our Fedora Core server. With still no sign of an update to our tzdata package, I decided it'd just be easier to find the sources and build the files myself. Thankfully, it worked out to be quite simple.

I suspect this process will work for most *nix systems, although I was working on a FC1 server, so your paths may be different under different flavours.

Step 1 - Get the source files

I found my tzdata sources from this site which contains information on the mailing list, and some comprehensive details on the files, sources, etc. It also directs you to the FTP server where you can download the most up-to-date files - The tzdata2006p.tar.gz file is the first to include the WA DST changes, so any version after that should suit you.

I also only downloaded the tzdata file, as our distro includes the timezone commands (such as zic) as part of the glibc-common package. I don't know if other distros do that. If not, the tzcode* file on the FTP server has all of the source files for these tools.

Step 2 - Extract the tzdata

Extract the tzdata*.tar.gz file into your directory of choice.

tar -xzvf tzdata2006p.tar.gz

Step 3 - Generate the binary Timezone Files with zic

zic compiles the textual timezone information files we just downloaded into a binary format that most of the glibc functions use. On our distro, zic will even install them into the correct location if you are running as root.

su -
/usr/sbin/zic australasia

In this case we've told zic to compile only the timezone information for Australasia. It's gone and updated our files under /usr/share/zoneinfo/Australia (and a few others for Indian and Pacific Islands).

If you're not feeling brave, you can also provide zic with a -d argument to specify another directory to output the files to, rather than letting it update the files on it's own. Check the man pages for more information.

Step 4 - Update the /etc/localtime file

Again, this depends on your distro - I've seen some systems where /etc/localtime is a symlink to the timezone file, however on our FC system it's an actual copy of the timezone file. I don't actually know which one is the better solution, but that's how our system installed, so I'm not about to tinker with the setup lightly.

So, we copy the timezone file over our existing /etc/localtime file (as root) :

cp /usr/share/zoneinfo/Australia/Perth /etc/localtime

Run date - it should hopefully still give you meaningful time, including timezone information.

Finishing Up

Now we just have to play the waiting game - in less than 5 days it'll either roll over to the new timezone silently, or else things will break horribly. Only time will tell!

Incidentally, wish Zanchey luck - apparently he's fighting with a heap of Windows machines and some problems with Exchange and timezones, and I suspect he may need all the support he can get!!!