[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: incorrect times displayed



On Wed, Apr 25, 2007 at 07:48:47 -0400, Steve Kleene wrote:
> On Sun, 22 Apr 2007 16:23:35 -0400, I wrote:
> 
> > I also tried adding this at the end of /etc/defaults/rcS:
> >
> > HWCLOCKPARS="--directisa"
> >
> > and rebooted.  That didn't fix it either.  Thanks anyway for the suggestion.
> 
> On Mon, 23 Apr 2007 20:26:03 +0200, Florian Kulzer replied:
> 
> > Just to make sure that we do
> > not have a misunderstanding here: Do you still get the "select() to
> > /dev/rtc..." error if you run the hwclock command with the "--directisa"
> > option?  (hwclock should bypass /dev/rtc when called like that,
> > therefore I am a pit puzzled.)
> 
> That's correct.  After adding this
> 
> HWCLOCKPARS="--directisa"
> 
> to /etc/default/rcS, rebooting, and running either of these
> 
>   hwclock --show
>   hwclock --set --date="23 Apr 2007 13:06:46"
> 
> I still get the message
> 
>   select() to /dev/rtc to wait for clock tick timed out

OK, now I see that my previous messages were unclear. You should try it
like this:

hwclock --directisa --show
hwclock --directisa --set --date="23 Apr 2007 13:06:46"

Adding HWCLOCKPARS="--directisa" to /etc/default/rcS means that this
option is used when hwclock is called during boot-up and shutdown, but
it has no influence if you run the command directly.

Here is a rough outline of how things are supposed to happen:

1) The hardware clock keeps track of time while your computer is off.

2) Linux reads the hardware clock during boot to set the system clock
   and then Linux keeps track of time without reading the hardware clock
   again. Optionally you can use ntp or chrony to synchronize your
   system clock to a network time server.

3) Linux saves the system clock's current time to the hardware clock
   during shutdown.

4) See 1)

If the hwclock command does not work then your computer sets the system
clock to a wrong time during boot, and even if you correct the system
clock later this will not be saved to the hardware clock when you shut
down your computer.

In summary: If you find an option to make hwclock work properly then you
have to put that into /etc/default/rcS. You also have to set the system
clock once more to the correct time (e.g. with the "date" command). From
then on the time should remain correct across reboots.

-- 
Regards,            | http://users.icfo.es/Florian.Kulzer
          Florian   |



Reply to: