Advertisement

hwclock and environment variables during shutdown

Started by February 24, 2006 11:24 PM
0 comments, last by 255 18 years, 9 months ago
I dual-boot this computer with Windows XP and Debian testing, and because of this I like to keep my hardware clock set to EST rather than UTC. This worked fine for quite some time, but a while back I somehow managed to foul Debian's understanding of the clock up. As a result it continually resets the the clock to time based on UTC, which causes problems when I switch between OSes. After some time looking into it I've concluded that the problem occurs in the hwclock.sh script executed during shutdown. More specifically, the script contains this block:

log_action_msg "Saving the system clock."
if [ "$GMT" = "-u" ]; then
    GMT="--utc"
fi
/sbin/hwclock --systohc $GMT $HWCLOCKPARS $BADYEAR
verbose_log_action_msg "Hardware Clock updated to `date`"
The problem is that for some reason, the GMT environment variable is set to -u, so the hardware clock is set to UTC every time the system shuts down. My problem, however, is that I can't find any way to change the environment variable. For starters the variable reports no value when using a command like echo $GMT as either my own user account or as root, yet somehow when init performs the shutdown, this value applies. If anyone could tell me how I can change this environment variable and have a clean way of keeping my system set to local time, I'd be very grateful.
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
According to the debian reference manual it might be in /etc/default/rcS

This topic is closed to new replies.

Advertisement