PDA

View Full Version : system timezone setting: more 'knoppix-like' suggestions?



olivers
10-24-2004, 01:53 PM
I've been having trouble setting the timezone on my hard-disk-installed knoppix system, because each time I reboot the file /etc/localtime gets overwritten with data for some other timezone (I think America/New York).

I came up with a solution, but am wondering if there is a simpler, more knoppix-like way to do this.

My solution was to add a new script to /etc/init.d:



#!/bin/bash
#The following lines update your /etc/localtime with data referred to in /etc/timezone
#The idea is to undo Knoppix's desire to overwrite timezone config each time we boot (done in knoppix-autoconfig)

OLIVER_TZ="`cat /etc/timezone 2>/dev/null`"
if [ -f "/usr/share/zoneinfo/$OLIVER_TZ" ]; then
rm /etc/localtime
cp "/usr/share/zoneinfo/$OLIVER_TZ" /etc/localtime
fi


I called it knoppix-hd-tzfix and linked it into the startup sequence as

ln -sf /etc/init.d/knoppix-hd-tzfix /etc/rcS.d/S02knoppix-hd-tzfix


FYI I'm using a system originally built from knoppix 3.4, installed using the knoppix-installer script (I think with the setting "knoppix" for the type of install). I've since upgraded many packages through apt-get.[/code]

Anybody else had this problem, and come up with a solution?

Steve F
10-24-2004, 04:24 PM
My answer might not apply to your configuration. I have 3.6 HD install as simple multiuser. I had trouble with timezone also. On kde I would 'set time' including the time zone, but the time display would always be an hour off. I thought it might be daylight savings time setting but couldn't find any way to set that. It turned out on kde you can set the system time by right clicking on the clock in the lower right corner. That works. I also had to select which time zone time I wanted the clock to show. There is a long list with every time zone. You select one or more time zones that will be listed in a drop down 'short list'. From the short list when I selected 'local time' it was an hour off for some reason. When I select my actual location from the 'short list' menu I get the correct time displayed.

scottknl
10-24-2004, 10:07 PM
I found the setting for the bootup timezone in my knoppix 3.6 hd install in the following location

/etc/init.d/knoppix-autoconfig

around line 433

Original Text:
*)
# American version
LANGUAGE="us"
COUNTRY="us"
LANG="C"
KEYTABLE="us"
XKEYBOARD="us"
KDEKEYBOARD="us"
CHARSET="iso8859-1"
# Additional KDE Keyboards
KDEKEYBOARDS="de,fr"
TZ="America/NewYork"
;;
esac

Change to:*)
# American version
LANGUAGE="us"
COUNTRY="us"
LANG="C"
KEYTABLE="us"
XKEYBOARD="us"
KDEKEYBOARD="us"
CHARSET="iso8859-1"
# Additional KDE Keyboards
KDEKEYBOARDS="de,fr"
TZ="America/Vancouver"
;;
esac

TZ="America/Vancouver" is my timezone, but you might substitute the one you want. On reboot. Voila you have the timezone set without any monkeying around.

There seems to be a similar section for the different language versions knoppix in the same file. If you're using the german version look for the section that sets the time zone under the de) section.

Hope this helps.
KS