LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Suse/Novell (http://www.linuxquestions.org/questions/suse-novell-60/)
-   -   Daylight savings time this year (http://www.linuxquestions.org/questions/suse-novell-60/daylight-savings-time-this-year-528228/)

pueblonative 02-12-2007 07:15 PM

Daylight savings time this year
 
Hi, I just got a report about Daylight savings time this year. Does anybody know the way to fix OpenSuse 10.2 in time, or does it even need fixing?

wjevans_7d1@yahoo.co 02-12-2007 08:06 PM

The following applies to any Linux distribution.

To find out whether you need to fix anything, do this:

Code:

date -d '27 March'
If it shows daylight time, you're set. If it doesn't, you need to update stuff:

Code:

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 -

Then read the README file and knock yourself out.

Hope this helps.

pueblonative 02-12-2007 08:19 PM

Thanks.
Quick question: I just set NTP through Yast. Will that help, or do I need to reboot?
And I know this sounds stupid, but hell, you ask and you only sound stupid once. Keep your mouth shut, and you're stupid forever.

wjevans_7d1@yahoo.co 02-13-2007 05:16 AM

NTP won't help with timezone issues. But you don't need to reboot either. As soon as you've installed the new files in the appropriate places (as per the instructions), you're good to go.

Can't help to do another

Code:

date -d '27 March'
when you're done, just as a sanity check. (My sanity, not yours. (grin))

statguy 02-22-2007 11:47 AM

I was about to update my timezome files on my SuSE 9.2 installation. I found directions elsewhere using the following command on the tzdata file contents.

Code:

zic -d /tmp/zoneinfo northamerica
This generated a bunch of things in /tmp/zoneinfo that I understand need to be copied to /usr/share/zoneinfo. However, here's my problem. In /usr/share/zoneinfo I see a directory called Canada and in there is the file Eastern. These correspond to the date and time settings I see in YaST.

How do I create the Canada timezone files?

wjevans_7d1@yahoo.co 02-23-2007 08:54 AM

The only way I'm familiar with is what I posted above in post #2. That way will generate the Canada timezone files and all the others.

statguy 02-23-2007 10:22 AM

Quote:

Originally Posted by wjevans_7d1@yahoo.co
The only way I'm familiar with is what I posted above in post #2. That way will generate the Canada timezone files and all the others.

Thanks. I am looking at the Makefile and am unsure of a couple things.

Since I want Canada/Eastern as my timezone, should I set both LOCALTIME and POSIXRULES to Canada/Eastern in the Makefile?

I'm a bit confused by TOPDIR. The default in the Makefile is /usr/local and I'm pretty sure I don't want to do that. Even if I set it to something like /usr/local/tzdir I don't know if things will work right. The following is from the Makefile.

Code:

# "Compiled" time zone information is placed in the "TZDIR" directory
# (and subdirectories).
# Use an absolute path name for TZDIR unless you're just testing the software.

TZDIR=          $(TOPDIR)/etc/zoneinfo

# The "tzselect", "zic", and "zdump" commands get installed in. . .

ETCDIR=        $(TOPDIR)/etc

# If you "make INSTALL", the "date" command gets installed in. . .

BINDIR=        $(TOPDIR)/bin

# Manual pages go in subdirectories of. . .

MANDIR=        $(TOPDIR)/man

# Library functions are put in an archive in LIBDIR.

LIBDIR=        $(TOPDIR)/lib
TZLIB=          $(LIBDIR)/libtz.a

If I read this right, everything will be installed under whatever I call TOPDIR. On my system, these things are not under one common directory. For example, I have

Code:

/usr/share/zoneinfo/
/usr/sbin/zic
/usr/sbin/zdump
/bin/date

Should I copy the stuff that gets installed in TOPDIR to other other places on my system?

Perhaps I'm being thick, but I just like to know what I'm doing to my system.

wjevans_7d1@yahoo.co 02-26-2007 12:15 PM

Quote:

Perhaps I'm being thick, but I just like to know what I'm doing to my system.
You're not being thick at all. More people should be as careful as you are.

Sorry about the delay in responding. I've had a software fire to put out at this end.

You don't need to replace any software at all, just the data which the software reads, and only that data which is under /etc/zoneinfo.

So:

Don't mess with LOCALTIME and POSIXRULES.

Under your current working directory (the one in which you'll be doing the make commands), create a new directory called (for example) installed.

Then set TOPDIR to ./installed.

Then compile and "install" everything. After doing that, you'll find something like ./installed/etc/zoneinfo.

As root, while no one else is on the system, do this:

Code:

mv -i /etc/zoneinfo /etc/zoneinfo.old.2007
cp -prd ./installed/etc/zoneinfo /etc/zoneinfo

All your old mechanisms for determing what the local time zone is, and so forth, are not affected by that. So they'll stay the same way they were. As a bonus, if a guest uses your computer and says at the bash prompt:

Code:

export TZ="US/Pacific"
Then he will get Mariposa time, but under the new rules.

Hope this helps.

pueblonative 02-26-2007 06:51 PM

Just got the automated updates through Zen.

statguy 02-28-2007 01:00 PM

Quote:

Originally Posted by wjevans_7d1@yahoo.co
Hope this helps.

Your posts were VERY helpful. Ironically, I will likely not need to use the information you have provided. The laptop on which SuSE 9.2 is running suddenly started misbehaving on the weekend (weird cooling issues). I will be replacing it and, obviously the OS too.

I've just installed 10.2 on a loaner and its timezone data is current.

Thanks again.

dougnc 02-28-2007 02:30 PM

Quote:

Originally Posted by statguy
I was about to update my timezome files on my SuSE 9.2 installation. I found directions elsewhere using the following command on the tzdata file contents.

Code:

zic -d /tmp/zoneinfo northamerica
This generated a bunch of things in /tmp/zoneinfo that I understand need to be copied to /usr/share/zoneinfo. However, here's my problem. In /usr/share/zoneinfo I see a directory called Canada and in there is the file Eastern. These correspond to the date and time settings I see in YaST.

How do I create the Canada timezone files?

So, it looks like I can do this:
Code:

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 -

Then, still in tz, do
Code:

zic -d /tmp/zoneinfo northamerica
Then just
Code:

cp -p /tmp/zoneinfo /usr/share/zoneinfo
I'm running SuSE Linux 9.3.

wjevans_7d1@yahoo.co 03-02-2007 10:43 AM

Quote:

Originally Posted by dougnc
So, it looks like I can do this:
Code:

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 -

Then, still in tz, do
Code:

zic -d /tmp/zoneinfo northamerica
Then just
Code:

cp -p /tmp/zoneinfo /usr/share/zoneinfo
I'm running SuSE Linux 9.3.

I'd be careful about that if I were you. The first step is fine. But the part that you do while "still in tz" should be not

Quote:

Code:

zic -d /tmp/zoneinfo northamerica
Then just
Code:

cp -p /tmp/zoneinfo /usr/share/zoneinfo

but something like

Code:

make TOPDIR=tz1 install
cp -r tz1/etc/zoneinfo /etc/zoneinfo
chmod -r 755 /etc/zoneinfo

This would be less risky and take almost no additional time. It would also provide you with all time zone information for everywhere. That doesn't sound important, and might not be, but you never can tell when you'll need what.

dougnc 03-07-2007 05:08 AM

Quote:

Originally Posted by wjevans_7d1@yahoo.co
I'd be careful about that if I were you. The first step is fine. But the part that you do while "still in tz" should be not



but something like

Code:

make TOPDIR=tz1 install
cp -r tz1/etc/zoneinfo /etc/zoneinfo
chmod -r 755 /etc/zoneinfo

This would be less risky and take almost no additional time. It would also provide you with all time zone information for everywhere. That doesn't sound important, and might not be, but you never can tell when you'll need what.

Thank you!. I had to change the cp -r to cp -R and in SuSE 9.3 zoneinfo is in /usr/share, but I got it to work!.

gorilla128 03-10-2007 10:37 AM

Thanks folks... here's the complete script for your ~/tzupdate.sh. Had to omit zoneinfo from the destdir of the cp command as it was copying to .../zoneinfo/zoneinfo. On 10.1, I had to replace -r with -R for the chmod command.

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 -
make TOPDIR=tz1 install
if (test -d /etc/zoneinfo) then dest=/etc; else dest=/usr/share; fi
cp -R tz1/etc/zoneinfo $dest
chmod -R 755 $dest/zoneinfo

leesweet 03-11-2007 05:09 PM

Thanks for all the help, but this still isn't working. I've gotten the files, make'd them, cp'd them to /usr/share/zoneinfo on my 9.3 box, and the current time (or even date -d '27 Mar') still returns EST.

I'll reboot for the heck of it, but from what I read here, I shouldn't have to, right?

Edit: Never mind, for some reason, $TIMEZONE's not set. I set that by hand, and it's good. Now to set it by default globally.

Thanks for all the detailed help, and no thanks to Novell for not patching it!


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