Subject: ntpdate and kern.rtc_offset
To: None <>
From: Jukka Salmi <>
List: current-users
Date: 04/28/2006 00:01:15

on a i386 laptop running -current I have rtclocaltime=YES, ntpdate=YES,
/etc/localtime points to CET, and the system clock is set to local
time (CEST).

After /etc/rc.d/rtclocaltime sets kern.rtc_offset (to -120 in my case)
it seems to take some time until this setting takes effect. That's why
during the boot process /etc/rc.d/ntpdate (which is run immediately
after rtclocaltime) always needs to adjust a time offset by about -7200
seconds. Is this considered correct behaviour?

(Adding a `sleep 1' to the rtclocaltime script after kern.rtc_offset
is set seems to work around this problem...)

$ date; sysctl -w kern.rtc_offset=-120; date; sleep 3; date
Thu Apr 27 23:48:43 CEST 2006
kern.rtc_offset: 0 -> -120
Thu Apr 27 23:48:44 CEST 2006
Thu Apr 27 21:48:47 CEST 2006

I _think_ this sometimes caused the system to be off by two hours, but
I can't reproduce this right now...

Any comments?

TIA, Jukka

bashian roulette:
$ ((RANDOM%6)) || rm -rf ~