Subject: Re: Making rtc_offset changable at run time
To: None <tech-kern@NetBSD.ORG>
From: Martin Husemann <martin@duskware.de>
List: tech-kern
Date: 04/18/2003 15:36:44
On Fri, Apr 18, 2003 at 03:49:01PM +0400, Valeriy E. Ushakov wrote:

> What about importing FreeBSD's adjkerntz?

I don't like it ;-) It's a gross design from pre-rc.d times. Instead of
a rc.conf variable it is turned on/off by existense/non-existence of a 
file in /etc. But aside from that:

Besides managing a different offset variable inside the kernel (implementation
detail) it does three things:

 - adjust kernel offset to localtime offset on transition to multi user.
   This is exactly what I suggested

 - adjust the offset again on shutdown
   This could be easily acomplished with my solution too, but I decided not
   to do it, since Windows insist on changing to/from DST itself if the last
   boot was before the change

 - adjust the offset imediately if the DST starts/ends during run time
   This has the benefit that timestamps on msdosfs are still sane if you
   run NetBSD a longer time accross the DST start/end time.

I'm not sure the last point is worth the effort. I don't like time related
things magically changing while my machine is running multi user (thats why
I made "sysctl -w kern.rtc_offset" fail if securelevel > 0).

Maybe we should make the securelevel > 0 part a kernel compile time option,
and have users who care about this make a cron job run 
"/etc/rc.d/windowsrtc start" at the proper time? Maybe by giving cron
a notion for "run this when local DST changes"? (Which would be a good
idea, independend of this issue, IMHO)


Martin