[CLUE-Tech] hwclock on debian

David Anselmi anselmi at americanisp.net
Wed Feb 19 22:04:38 MST 2003


Randy Arabie wrote:
[...]
> 
> hwclock 2.4c/util-linux-2.11n
> Using /dev/rtc interface to clock.
> Last drift adjustment done at 1044504581 seconds after 1969
> Last calibration done at 1044504581 seconds after 1969
> Hardware clock is on local time
> Assuming hardware clock is kept in local time.
> Waiting for clock tick...
> ...got clock tick
> Time read from Hardware Clock: 2003/02/20 00:24:39
> Hw clock time : 2003/02/20 00:24:39 = 1045700679 seconds since 1969
> Wed Feb 20 00:24:39 2003  -0.229653 seconds
> 
> This tells me my kernel thinks this is local time, but in reality it is
> UTC.

What does your /etc/adjtime file say?  My guess is that the last line 
say LOCAL.

If that is the case, check your /etc/default/rcS file.  Does the line 
really say "UTC=yes" at the start of the line, with that capitalization, 
and with no trailing characters (e.g., the line enders are unix style, 
not dos)?

I can reproduce your problem if I put a ^M at the end of the UTC= line. 
  You can use cat -v to check.

You can also run these commands:

/etc/init.d/hwclock.sh stop
/etc/init.d/hwclockfirst.sh start
/etc/init.d/hwclock.sh start

by hand.  This will simulate a shutdown and reboot (so you can test 
different rcS files without actually rebooting).  Try it and see what 
the output is.  I get some error messages with a ^M at the end of the line.

Unfortunately this isn't exactly the same as shutdown and reboot in all 
cases, but it should be close enough.  Always puzzled me why the kernel 
logs so much stuff on boot and the boot scripts log nothing.  I 
understand the technical difficulty but it seems useful enough to figure 
out a way around it.

HTH,
Dave




More information about the clue-tech mailing list