Red Hat 6.0 System Clock vs. Hardware Clock

Red Hat 6.0 System Clock vs. Hardware Clock

Post by mmkoc » Sun, 31 Dec 1899 09:00:00



Hi!

I bought Red Hat Linux 6.0 in August 1999 and have been learning about
it ever since. One of the toughest challenges that remains is to get
the Software Clock to keep and show the right time. It loses something
like 10 hours every day! I confirm this via date.

I checked the Clock Mini-HOWTO and found both hwclock and adjtimex as
possible solutions to this problem. The latter was not initially
installed with Red Hat Linux 6.0 (why not, if this is the only way to
adjust the Software Clock?) so I had to RPM it separately. By the way, I

am always logged in as ROOT when I attempt what follows.

I checked the Hardware Clock with hwclock --show and it turns out this
clock is exactly on the money. I then tried to synchronize the
Software Clock with the Hardware Clock via hwclock --hctosys. This works
for a few minutes but then my Software Clock loses time
again. By the way, this is bad enough enough while someone (e.g. myself)
is logged in, but without anybody logged in, i.e. Linux displaying only
the login prompt, it seems to be worse - but that may be subjective.

I then attempted to use adjtimex --frequency, but with 100 ppm, i.e.
10E-4 s/s or 8.64 s/d maximum possible correction, I don't see how it
can possibly compensate for the above several h/d. Then I attempted to
use adjtimex --ticks, but again, with 100,000 ppm, i.e. 10E-1 s/s or
2.4 h/d maximum possible correction, I still don't see how it can
compensate for up to 10 h/d. To this day, and even after adjtimex
--compare and adjtimex --adjust, i.e. even after trying to do the
adjustment in an "automatic" fashion, there is no improvement in the
Software Clock..

Finally, I attempted to use brute force, i.e. crontab for an hourly
hwclock --hctosys command. I did a crontab -e with emacs and added the
following lines:

  01 * * * * /bin/date                >> /root/crontab.log 2>&1
  02 * * * * /sbin/hwclock --show     >> /root/crontab.log 2>&1
  03 * * * * /etc/cron.hourly/hctosys >> /root/crontab.log 2>&1
  04 * * * * /bin/date                >> /root/crontab.log 2>&1
  05 * * * * /sbin/hwclock --show     >> /root/crontab.log 2>&1
  10 1 * * 0 rm -f /root/crontab.log  >> /root/crontab.log 2>&1

Hereby, the file /etc/cron.hourly/hctosys contains nothing but the line
/sbin/hwclock --hctosys. The following is a recent /root/crontab.log
output of this construct. It makes little to no sense to me! In
particular, the output sequence should be
date-hwclock-date-hwclock, but this seems to get messed up! Note that
date does not generate a "seconds" entry, but hwclock does!

Fri Dec 24 21:54:12 EST 1999
Fri Dec 24 21:54:12 EST 1999
Fri Dec 24 21:54:14 1999  -1.208804 seconds
Fri Dec 24 21:54:15 1999  -2.327327 seconds
Fri Dec 24 22:01:06 EST 1999
Fri Dec 24 22:01:26 1999  -0.967979 seconds
Fri Dec 24 22:03:20 EST 1999
Fri Dec 24 22:04:56 1999  -1.053506 seconds
Fri Dec 24 23:01:06 EST 1999
Sat Dec 25 11:43:01 1999  -0.761735 seconds
Sat Dec 25 11:44:55 EST 1999
Sat Dec 25 11:44:55 EST 1999
Sat Dec 25 11:44:53 1999  2.279907 seconds
Sat Dec 25 11:44:54 1999  1.329292 seconds
Sat Dec 25 12:01:05 EST 1999
Sat Dec 25 12:00:33 1999  -0.826457 seconds
Sat Dec 25 12:02:26 EST 1999
Sat Dec 25 12:04:56 1999  -1.051199 seconds

What is going on??? I really enjoy my Linux system, but this system time
thing is really a serious downer! Has anybody ever encountered a similar
problem? Can anybody tell me what to do? Am I doing something wrong or
maybe not at all? Why won't my Software Clock work right? Unfortunately,
I did not really notice or rather take serious this time problem until
after expiration of the 90 day Red Hat support. Help - Please!!!

Matt Koch

 
 
 

1. hwclock (system clock to hardware clock)???

Hi All,

My app needs to be able to set BOTH the system date/time
and the Hardware Date/Time.

It runs as suid root and it can change the system time OK using
stime().
Unfortunatley setting the CMOS or hardware clock
using system("/sbin/hwclock --systohc"); does not work???

Is there a way of getting the hardware clock to be the same as
system clock through the program???

Anyhelp appreciated.

P.S. I am using Linux Redhat 5.1.
--
Nick Thomas
Software Developer
Advanced Control Systems Ltd
WWW: http://www.advcontl.demon.co.uk

2. OpenServer 5 locks at 'G' at first boot after install

3. System clock MUCH slower than hardware clock

4. routing problem

5. Hardware clock OK, system clock losing 15 mins daily

6. WD8003E trouble

7. System clock vs some other clock???

8. Sort by File Size

9. red hat messes around with system clock

10. Hardware vs. system clock

11. Setting my hardware clock to atomic clock?

12. udb, hardware clock and 'clock -w'

13. Triteal CDE: Digital Clock Vs Old fasion Clock