Operating System - Linux
1838640 Members
2353 Online
110128 Solutions
New Discussion

Re: system time increments by 5 hours at eache reboot - plz help

 
SOLVED
Go to solution
Maaz
Valued Contributor

system time increments by 5 hours at eache reboot - plz help

Hello Dear Experts

I have a dual boot system, i.e. rhl9 and windows are both installed on the same machine.
Prblm is that whenever I boot/reboot my system in rhl9, the system time increments exactly by 5 hours. for e.g, If if boot my system in rhl9, and the time it shows/display is 1:0:0, then if i reboot my system in rhl(init 6) then it will show the time 6:0:0, and so on, i,e whenever I reboot my system in rhl9 it will aoutomatically inrement the system time exactly 5 hours.
since it only happens when I reboot my system in rhl9, i.e. If i reboot my system in windows, then windows doesnt increases the time, so that It must be a linux issue/prblm.


On this very machine I have used rhl7.x for a long period, and during the rhl7.x regime, this prblm didnt happen

plz help me resolving the issue.

Any help/suggestion/respone will be Highly appreciated.

Thanks in Advance

Regards
Maaz.
17 REPLIES 17
Alexander Chuzhoy
Honored Contributor

Re: system time increments by 5 hours at eache reboot - plz help

I think that you use a wrong time region.Run the command:
redhat-config-date
or
dateconfig
and see if there's a correct region zone set.
Maaz
Valued Contributor

Re: system time increments by 5 hours at eache reboot - plz help

No dear Alexander, time zone is set properly.



Huc_1
Honored Contributor

Re: system time increments by 5 hours at eache reboot - plz help

Well if this is only true when you boot from rh9 then it is not the internal (i mean the physical) clock, so it is a software offset somewhere in the oparating system, and perhap you have overlooked something or something is corrupted

I would start by the following
# zdump /etc/localtime

this should return something like
/etc/localtime Sun Nov 21 14:15:25 2004 CET

the time zone should be the correct one, the time should be the right one and the file should be dump corectly by zdump (oe else it is corrupted)

Time problem can be fustrating to track but keep us informed.

hth

J-P
Smile I will feel the difference
Thomas J. Harrold
Trusted Contributor

Re: system time increments by 5 hours at eache reboot - plz help

Have you checked to see if NTP is configured for this system? In particular, if you are running an "ntpdate" at boot to set the time.

This would probably be set in one of the /etc/init.d scripts.

It sure sounds like a timezone problem, though.

If you need a workaround, you can use "ntpdate", in conjunction with ntp. (/etc/ntp.conf)

It's not overly difficult to setup ntp.

-tjh
I learn something new everyday. (usually because I break something new everyday)
Maaz
Valued Contributor

Re: system time increments by 5 hours at eache reboot - plz help

Many Thanks dear HUC
yes HUC, its purely rhl9 issue, nothing is wrong phisically.
# zdump /etc/localhost
/etc/localhost Sun Nov 21 22:01:20 2004 PKT


Many Thanks dear Thomas J Harrold
this is a standalone system i.e no ntp server is configured. the system is running its own local time.
# ntpdate
22 Nov 03:00:32 ntpdate[627]: no servers can be used, exiting
Alexander Chuzhoy
Honored Contributor

Re: system time increments by 5 hours at eache reboot - plz help

If you'll change the time with
date -s

will it return to a wrong time after reboot?
Maybe that all you need to do.After all you don't use ntpd....


Best regards.
Maaz
Valued Contributor

Re: system time increments by 5 hours at eache reboot - plz help

Yes Alexander .. it return to wrong time after reboot
i did as
# date -s 23:10:15; init 6
# date
Mon 04:12:11

Maaz
Ermin Borovac
Honored Contributor

Re: system time increments by 5 hours at eache reboot - plz help

Check /etc/sysconfig/clock file. If you hardware clock (bios) is set to local time then you need to set UTC to false.

$ grep UTC /etc/sysconfig/clock
UTC=false

Check what your hardware clock is set to with

# /sbin/hwclock
Maaz
Valued Contributor

Re: system time increments by 5 hours at eache reboot - plz help

Dear Ermin Borovac here are the results

# grep UTC /etc/sysconfig/clock
UTC=false
# date; /sbin/hwclock
Tue Nov 23 03:50:50 PKT 2004
Mon Nov 22 22:50:51 2004 -0.017312 seconds

# init 6

# date; /sbin/hwclock
Tue Nov 23 08:54:08 PKT 2004
Tue 23 Nov 2004 03:54:09 AM PKT -0.450678 seconds

Regards
Maaz
Ermin Borovac
Honored Contributor

Re: system time increments by 5 hours at eache reboot - plz help

Your hardware clock is getting synced to system time when to switch to runlevel 6 (/etc/rc.d/rc6.d/S01reboot). On reboot, system time should get set from hardware clock time (/etc/rc.d/rc.sysinit) and that is not happening.

Is /etc/localtime link to a file in /usr/share/zoneinfo/?/?. If so, delete the link and copy /usr/share/zoneinfo/?/? file (that /etc/localtime was previously linked to) to /etc/localtime.
Thomas Bianco
Honored Contributor

Re: system time increments by 5 hours at eache reboot - plz help

you probably live on the east cost.

windows is stupid and stores local time in the system clock, as opposed to most unix systems, that store GMT in the clock, then do a timezone adjust in runtime.

configure redhat to store local time in the bios, http://www.linux.com/howtos/TimePrecision-HOWTO/set.shtml
There have been Innumerable people who have helped me. Of course, I've managed to piss most of them off.
Maaz
Valued Contributor

Re: system time increments by 5 hours at eache reboot - plz help

Dear Ermin as I understand the instruction u provided ... I did the following

# ls -l /etc/localtime
lrwxrwxrwx 1 root root 32 Nov 23 20:56 /etc/localtime -> /usr/share/zoneinfo/Asia/Karachi
# rm -f /etc/localtime
# ln -s /usr/share/zoneinfo/Asia/Karachi /etc/localtime
#

yes Dear Ermin Borovac ... u mentioned the right prblm ... infact(in my case) when the system boots in rhl9, rhl doesnt set/get its time from hardware, and but rhl automatically increase the time by +5 hours, and when the system is preparing to shutdown , the linux(software) sets the hardware clock.


Many Thanks to Thomans. And Thomans Bianco I m here in Karachi, Pakistan. Ok, I'll check the url and try to solve the issue.

Regards
Maaz
Thomas Bianco
Honored Contributor

Re: system time increments by 5 hours at eache reboot - plz help

signing problem, pakistan is +5, USA East coast is -5.
http://aa.usno.navy.mil/graphics/TimeZoneMap2003.pdf

PS, this is a Zero-point post.
There have been Innumerable people who have helped me. Of course, I've managed to piss most of them off.
Ermin Borovac
Honored Contributor
Solution

Re: system time increments by 5 hours at eache reboot - plz help

Sorry for misunderstanding, I was suggesting the following

# ls -l /etc/localtime
lrwxrwxrwx 1 root root 32 Nov 23 20:56 /etc/localtime -> /usr/share/zoneinfo/Asia/Karachi
# rm -f /etc/localtime
# cp /usr/share/zoneinfo/Asia/Karachi /etc/localtime
Maaz
Valued Contributor

Re: system time increments by 5 hours at eache reboot - plz help

I m highly thankful to u, for ur kind help, and for ur continous help.
u were 100% right ... u made the right suggestions.

By following ur suggestion, prblm has been solved

# rm -f /etc/localtime
and then
# cp /usr/share/zoneinfo/Asia/Karachi /etc/localtime

But Dear Ermin ... could u plz le me know what was the prblm, I mean if /etc/localhost is linked to /usr/share/zoneinfo/Asia/Karachi, it will cause the prblm ... and when I followed ur instruction, that is delete ths link, and then simple copy .../Karachi to /etc/localhost, the prblm gone ... so could u plz explain ?

Many Thanks to All.

Regards
Maaz



Ermin Borovac
Honored Contributor

Re: system time increments by 5 hours at eache reboot - plz help

I think this is because /usr is separate filesystem. On system boot, system time is set from hardware clock time in /etc/rc.d/rc.sysinit using hwclock. hwclock uses /etc/localtime to set the system time. When the script runs /usr is not mounted yet, so /etc/localtime is just invalid symbolic link.
Maaz
Valued Contributor

Re: system time increments by 5 hours at eache reboot - plz help

Again Many Thanks for great Explanation.
Yes /usr is a separate partition.