hwclock, rtcwake, /etc/adjtime

Martin Dengler martin at martindengler.com
Sat Aug 22 15:38:32 UTC 2009


On Sat, Aug 22, 2009 at 10:41:14AM +0545, Daniel Drake wrote:
> 2009/8/22 Paul Fox <pgf at laptop.org>:
> > okay.  you had said that kickstart creates /etc/sysconfig/clock,
> > and that that's what you'd fixed.  mtd's distro has "UTC=True" in
> > that file, so i figured he already had your fix.

Yes, I/soas-on-xo1 does have the fix.

> > oh -- unless soas-on-xo1 doesn't use kickstart, and more needs to
> > happen if it doesn't.

soas-on-xo1 does use kickstart.

> ok, maybe it's not the complete fix then.

It's not, it appears, due to the below.  That being said, I've just:

- created a new image and booted it fine
- confirmed /etc/adjtime has neither LOCAL nor UTC
- tested rtcwake (works fine)
- confirmed /etc/sysconfig/clock has "UTC=True"
- rebooted
- confirmed /etc/adjtime now has LOCAL in it (see below)
- tested rtcwake (works fine)

so go figure.


> Here's how I would expect things to work:
> 
> kickstart puts UTC=True in /etc/sysconfig/clock

Yes, this happens

> this makes fedora init scripts always call hwclock with --utc

This is the problem.  /etc/init.d/halt just does:

/sbin/hwclock --systohc

...which is documented[1] to default to localtime in these
circumstances.

Also, 'grep UTC /etc/init.d/*' turns up nothing.

> and this option makes hwclock write "UTC" in /etc/adjtime

...so this never happens.

> Perhaps my understanding is flawed/incomplete, or there is a bug
> somewhere.

Indeed.  At the very least, I'm not sure what the point of
/etc/sysconfig/clock's UTC=true setting is.

> Daniel

Martin


1. http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=blob;f=hwclock/hwclock.8;h=55663fef37aa8531ac71d82c34af418bcf274a27;hb=HEAD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-olpc-list/attachments/20090822/b1eeaf07/attachment.sig>


More information about the Fedora-olpc-list mailing list