Skip to contentSkip to conversation

Problem in clock setting

DISCUSSION Karunambaran A 2 participants 3 messages May 30, 2003 – Jun 4, 2003

lore
Share & tools
lore
#0 lore raw

Hi,
I have installed RedHat Linux 9.0 in my home PC. My BIOS clock
is set to local time. During installation of RH 9.0 I have selected my time zone as Asia/Calcutta and the UTC box unchecked. But while booting I am getting the message as if the hardware clock is set UTC and as a result the system clock is set 5 hrs 30 minutes more to make it IST(Asia/Calcutta). But since my hardware clock is already IST localtime it results a wrong system clock. I am able to solve the problem by adding the command "/sbin/hwclock --hctosys " at the end of /etc/rc.d/rc.sysinit file ( before the " wait " ).

In rc.sysinit file there is one command
" /sbin/hwclock $CLOCKFLAGS "
I have echoed the CLOCKFLAGS variable and it shows as I expected
the following

--hctosys --localtime

My question is why the time is recognized
as UTC ?( Other OS in my PC does not have any problem in the clock. I have been installing all RH versions since 6.2 and this problem is for the first time. Also, in my office PC I installed RH 9.0 and the clock is fine)

Thanks in advance for any reply.

Sorry if I am not properly conveying my problem.

#1 lore raw
Quoted 15 lines · Karunambaran A

I have installed RedHat Linux 9.0 in my home PC. My BIOS clock
is set to local time. During installation of RH 9.0 I have selected my time zone as Asia/Calcutta and the UTC box unchecked. But while booting I am getting the message as if the hardware clock is set UTC and as a result the system clock is set 5 hrs 30 minutes more to make it IST(Asia/Calcutta). But since my hardware clock is already IST localtime it results a wrong system clock. I am able to solve the problem by adding the command "/sbin/hwclock --hctosys " at the end of /etc/rc.d/rc.sysinit file ( before the " wait " ).

In rc.sysinit file there is one command
" /sbin/hwclock $CLOCKFLAGS "
I have echoed the CLOCKFLAGS variable and it shows as I expected
the following

Quoted 7 lines

--hctosys --localtime

My question is why the time is recognized
as UTC ?( Other OS in my PC does not have any problem in the clock. I have been installing all RH versions since 6.2 and this problem is for the first time. Also, in my office PC I installed RH 9.0 and the clock is fine)

Is there any reason why hwclock might not be able to read the "localtime" file at startup? E.g. if /etc/localtime is a symlink to the zone file in /usr/share/zoneinfo, but /usr is a separate filesystem, hwclock won't be able to read it if it is run before /usr is mounted (which is normally the case at startup).

Signature · 1 line
Glynn Clements <[email protected]>
#2 lore raw
Quoted 8 lines
Quoted 7 lines

My question is why the time is recognized
as UTC ?( Other OS in my PC does not have any problem in the clock. I have been installing all RH versions since 6.2 and this problem is for the first time. Also, in my office PC I installed RH 9.0 and the clock is fine)

Quoted 8 lines

Is there any reason why hwclock might not be able to read the "localtime" file at startup? E.g. if /etc/localtime is a symlink to the zone file in /usr/share/zoneinfo, but /usr is a separate filesystem, hwclock won't be able to read it if it is run before /usr is mounted (which is normally the case at startup).

Signature · 1 line
Glynn Clements <[email protected]>

Very many thanks.
That's exactly the reason. I
removed the sym link and copied /usr/share/zoneinfo/Asia/Calcutta to /etc/localtime to get the desired result.

From RH Linux 6.2 to RH Linux 8.0 also my / and /usr was on
different partitions and this problem never occured. May be it was not a sym link earlier, I hope.

Thanks again for the insight you provided.