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 |


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: rtc: how should I handle an invalid state?
    ... Which version of hwclock? ... Using /dev interface to clock. ... Assuming hardware clock is kept in local time. ... Some RTC drivers do this themselves: ...
    (Linux-Kernel)
  • Re: Linux 11-minute mode (RTC update)
    ... even though hwclock thinks the kernel is in 11-minute mode, ... I've removed the code where the kernel writes to the RTC. ... WARNING from hwclock: The clock was in 11 minute mode, which normally means that something else, possibly an NTP daemon, has been setting the hardware clock. ...
    (comp.protocols.time.ntp)
  • Re: [SLE] Setting time
    ... > A week or so later do, again as root: ... > hwclock now calculates how much your clock is running too fast or too ... > More info: man hwclock. ... I was trying to fix a clock systematic drift in an old 486 running debian ...
    (SuSE)
  • Re: Changing time, Ubuntu 10.04 Live USB
    ... I meant a live USB-stick all the way. ... Currently found out i had to change etc/default/rcS, a it said UTC=yes, changing it to no seems to give me persistent right clock. ... I run sudo hwclock, output -> 22.06 ... system time" and it corrects ...
    (Ubuntu)
  • Re: [opensuse] adjtime in openSUSE 11.2
    ... My system clock tends to stray ... Since I run ntpd I don't worry about the hardware clock. ... HWCLOCK it says ... The Adjust Function ...
    (SuSE)