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

Re: Scary bugs

On Fri, 04 Feb 2000, Hamish Moffatt wrote:
> On Thu, Feb 03, 2000 at 11:43:04AM +0100, Pavel Epifanov wrote:
> > Please, remove this command (--systohc). I hope It will fix the reported bug.
> > And I want to have one customised file less on all my computers.
> remove --systohc? Madness! It is a useful function.

Before we start yet another shouting match, I suggest everyone to read the
new version of the /etc/init.d/hwclock.sh file (in the new util-linux
package, still in incoming as far as I know). Or read the diffs I sent to
this list a few days ago.

--systohc is necessary for two reasons (IMHO): 
  NTP and any other true timekeeping strategies need it to keep the RTC
  correctly updated, even if the kernel is told to enter 11 minute mode.
  The most simple approach to the clock: a "one single clock" model requires

Also, do not confuse --adjust and --systohc, --systohc does not apply any
sort of drift correction.

In short: 

1. We need --hctosys on startup, or we need another utility to set the
   kernel timezone AFAIK. Maybe glibc sets the kernel TZ, but I doubt it.

   The kernel will copy the RTC time to the system clock regardless of
   --hctosys, but will not set the timezone. If anything enables 11 minute
   mode with the kernel TZ incorretly set, your RTC time will probably be
   set incorrectly as well.

   --hctosys on startup is the expected behaviour, and it is analogue of
   what Windows, DOS, and other Linux distributions do.

2. By default we shoudln't enable --adjust because it can cause
   hard-to-track errors for the uninitiated, and it causes more headaches
   than its worth for anyone who didn't take his time to read, install and
   use an advanced timekeeping system (ntp/chrony, adjtimex, ntpdate...).

   Even for people using advanced timekeeping software, --adjust may be
   dangerous and hwclock should be modified to at the very least apply
   sanity checks and optional limits to the corrections it does to the drift
   file and the RTC.  This is stuff for woody, and I'll send a RFC dealing
   with hwclock --adjust patches to -devel for discussion soon.

   No drift compensation at all (no --adjust) is the expected behaviour for
   anyone coming from Windows and DOS as well as most basic users. I am not
   sure on this, but I don't recall any of my RedHat boxes attempting drift
   correction either. Therefore (IMHO) this (--adjust disabled) should be
   our default until every single drawback in --adjust is fixed.

3. --systohc on shutdown (without --adjust, and with --hctosys on startup)
   is needed to allow users to use the "one clock" approach. It is also
   needed for correct NTP operation. It is probably desired by anyone using
   ntpdate as well.

   It is a safe default: it is the expected behaviour for users coming from
   Windows. Users coming from DOS might or might not expect it (my version
   of DOS updated the RTC everytime I issued the DATE or TIME command to set
   the system clock, but otherwise left it alone). 

   Turning --systohc off by default requires documentation updates to a
   number of other packages (I've some bugs already filled on this topic
   because this documentation is a good thing to have anyway), as well as
   updates to their config scripts to suggest enabling the feature back.  

   I have no idea if other linux distributions do a --systohc on shutdown,
   but the only place I've ever read/heard the notion that the RTC should be
   left untouched by a non-ntp-enabled system is the hwclock (8) manpage
   which has no business at all in giving such out-of-their-control
   information to begin with.

  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh 

Reply to: