linux-mips
[Top] [All Lists]

Re: Updating RTC with date command

To: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Subject: Re: Updating RTC with date command
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Tue, 19 Jul 2005 16:06:21 +0100 (BST)
Cc: linux-mips@linux-mips.org
In-reply-to: <20050719144230.GE20065@lug-owl.de>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <CBD77117272E1249BFDC21E33D555FDC06018D@dbde01.ent.ti.com> <20050719143110.GD3108@linux-mips.org> <20050719144230.GE20065@lug-owl.de>
Sender: linux-mips-bounce@linux-mips.org
On Tue, 19 Jul 2005, Jan-Benedict Glaw wrote:

> hwclock is the userspace utility to manually once set the time. In
> normal operation, this should only be called _once_, after the system is
> switched on for the very first time.

 Well, `hwclock' should normally be used to update the RTC every time 
after a manual system clock update.

> During lifetime, ntpd should execute and thus the system's current time
> will be written to the HW clock every now and then. Additionally, most

 Note that ntpd only updates minutes and seconds and then only if the 
difference is small -- to account for the existence of time zones and a 
system-specific relation between the time recoreded by the system and one 
handled by the RTC.  Also the feature is broken by design -- ntpd 
shouldn't do that at all in principle and in practice it leads to the 
system time being corrupted on some machines using an RTC interrupt for 
the system timer tick.

> distributions seem to also update the HW clock at system shutdown time.

 Which is where it should really happen.

> So the correct solution to your problem is to either shutdown once
> (workaround) or keep ntpd running (the solution[tm]).

 I think you've got the figures reversed (well, it's useful to have ntpd 
running, but it should not fiddle with the RTC).

  Maciej

<Prev in Thread] Current Thread [Next in Thread>