Thank you for your reply.
I think you are misunderstanding what I mean.

The ntp will update the system clock hourly only.
But I have used /bin/date and perl script to check the system at anytime,
the reported system clock will 1-4 seconds less than previous report(just 1
second interval between 2 report) at any instant, sometime. 

That mean the system clock will decrease is not related to ntpd. 
Below is the perl script I wrote to check system time, you will found the
output sometime will be negative or 0, or greater than 1. On a problem less
Linux system, all output should be 1.
So do you have any idea what problem is going on?
----[perl time function result----------------------------------------------
[EMAIL PROTECTED] root]# cat a.cgi
#!/usr/bin/perl

while (1) {
   my $init_time = time;
   sleep(1);  
   print time-$init_time, "\n";
}

[EMAIL PROTECTED] root]# perl a.cgi  
1
-2
1
1
1
1
2
0
1
1
2
0
4
-2
1
1
1
1
3
1
1
-1
3
1
1
-1
1
3
1

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Leonard den Ottolander
Sent: Wednesday, July 09, 2003 7:24 AM
To: [EMAIL PROTECTED]
Subject: Re: /bin/date time is jumping backward, please help

Hi Horace,

> I am added "/usr/sbin/ntpdate stdtime.gov.hk" command to /etc/cron.hourly/
path
> that let the crond to do the System time update for every hour.
> 
> ->Does your system keep setting its time from the hardware clock etc.?
> No.
> 
> Could you tell me what info you want.
> I have check the Hardware clock by using "hwclock", and the time is
> monotonic increasing. But the /bin/date sometime will be decrease for 1-4
> seconds.

 Ntp and ntpdate only set the system time, not the hardware clock. This
means 
hwclock and date will not always produce the same time. To set the hardware 
clock to the current system time use hwclock --systohc. Red Hat systems do 
this automatically on shutdown I believe.

 If your system time is not correct it will be udpated every hour by
ntpdate. 
This could explain the time shift. If you have a bad system clock (f.e. an
old 
battery) after every boot your system time might shift a few seconds at the 
first cron job, but it shouldn't change too much after that. (In your case
it 
looks like your hardware clock is actually running too fast, which would 
explain the backward shift of a few seconds. Again, this shift usually is
only 
this big the first time the clock is updated.)

Bye,
Leonard.

--
How clean is a war when you shoot around nukelar waste?
Stop the use of depleted uranium ammo!
End all weapons of mass destruction.


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to