Hello everyone, I have the following problem: I installed 11.2 on a laptop with the hardware clock said to run on local time (CE(S)T), expecting to do a dual-boot Windows setup later. That plan got scrapped, and the to-DST switchover lately failed, so I’d like to switch the hwclock to UTC.
By now, I have (coming to work at 08:53 CEST = 06:53 UTC today):
(I should probably mention that I also had to add /etc/rc.d/rc*.d/K01boot.clock symlinks - which will do a --systohc on shutdown - to stop the time from drifting further and further into the past …)
> Also you may want to delete any /etc/adjtime to prevent it from having any effect.
Thanks, I’ll try that. Though it looks correct to me, as far as I know adjtime syntax:
Desktop clock, YaST2, /etc/sysconfig/clock and date all agree that my local time is that of Germany (and, where applicable, that the RTC is set to UTC).
I’d hope not (refurbished laptop bought only months ago), though I wouldn’t know offhand how to check that. But … if the CMOS batt were failing, the RTC should get reset to a fixed value, rather than lagging 2h behind the correct time on every boot, right?
Alright everyone, at least I located the problem now …
# egrep '^ ]*(-_|A-Za-z]*\)|(if|elif|else) |fi$)' /etc/init.d/boot.clock.orig
if test -e /dev/rtc ; then
fi
if test -z "$(/sbin/modprobe -l rtc_cmos)" ; then
fi
if /sbin/modprobe -q rtc_cmos ; then
if test $start -lt $end ; then
fi
fi
start|restart|reload|force-reload)
if test -n "$SYSTEM_TIME_INCORRECT" ; then
fi
if test "$USE_HWCLOCK" != yes ; then
if test -n "$TIMEZONE" -a -x /usr/sbin/zic ; then
fi
fi
if test "$ELEVENMIN_MODE" = yes ; then
fi
if test "$USE_ADJFILE" = yes ; then
if test ! -s /etc/adjtime ; then
fi
stop)
if test "$ELEVENMIN_MODE" = yes ; then
fi
if test "$USE_HWCLOCK" = yes -a "$SYSTOHC" = yes ; then
if test "$USE_ADJFILE" = yes ; then
fi
fi
timezone)
if test "$USE_HWCLOCK" = yes ; then
fi
status)
Note that within the code for the “start” case, there is NO branch for the “$USE_HWCLOCK” = “yes” situation.
The debug code I added to the start script starts its log as follows:
# head -7 /var/tmp/clockstart.log
### START called, TZ:
### Runlevel: unknown
### Called as: /etc/init.d/boot.clock start
### Hardware Clock: Tue May 4 12:10:10 2010 -0.234620 seconds
### System Time: Tue May 4 10:10:10 CEST 2010
So something sets the system time to the wrong value I observe even before the usual boot scripts get run, and /etc/init.d/boot.clock does nothing when run. The culprit most likely is the initrd: