Subject: Re: where does time come from?
To: Perry E. Metzger <perry@piermont.com>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 09/25/2002 19:30:49
On 25 Sep 2002 10:10:58 -0400, "Perry E. Metzger" <perry@piermont.com>
wrote:
> "James K. Lowden" <jklowden@schemamania.org> writes:
> > > > Is the TOD clock initialized from time information on the root
> > > > filesystem, or is it possible my system was compromised and
> > > > tampered with?  
> > > 
> > > Did you ignore the following boot message?
> > > 
> > >                 printf("WARNING: clock time much less than file
> > >                 system time\n"); printf("WARNING: using file system
> > >                 time\n");
> > 
> > Well, no, not as far as I can tell:
> > 
> > # zcat /var/log/messages.* |grep WARN
> > Sep 24 06:10:56 home root: WARNING: /etc/sendmail.cf not readable; 
> > sendmail not started.
> > # cat /var/log/messages |grep WARN
> 
> Ah, no. this is a printf, not a syslog. That has to be because it runs
> before there is even a disk drive mounted to log *to*. inittodr is run
> really early in the life of the machine. You could find this in your
> dmesg but not in /var/log messages. I'd tell you to look in dmesg.boot
> but that file was a post 1.4 invention I believe.

Silly me, I get it.  For the record, 1.4.2 does have dmesg.boot, but no
warnings have I:

	# grep WARN /var/run/dmesg.boot #dmesg shows same
	# 

> Of course, after inittodr is run, the CMOS clock is never read
> again on a machine like yours, so this can only be seen the once
> during boot.

("Of course", he says. :))  Sure, ahem, I knew that.  

> You said it was a rattletrap and it is running 1.4.x -- that doesn't
> seem "quite new" to me -- and what you describe is precisely the
> symptom of a dead CMOS battery. 

Ah, well, I may perhaps put a higher premium on laziness than you do.  

The software was first installed on a 200 MHz Pentium II circa 2000. 
Maybe a year later, that machine's IDE controller died.  (NetBSD
heroically stumbled on for several days until the ever-alert
sysadmin-who-shall-remain-nameless peeked at the console.)  Three days
later the same old disks were installed in the present chassis, atop a
brand-spanking new 800 MHz AMD.   So it's maybe a year old, definitely not
two.  

I thought, "NetBSD runs on friggin' anything that doesn't rust.  I'll
upgrade later."  I was right, on both counts.  

Thanks for the interest you're taking in my plight, Perry.  I'm sorry I
can't better conform facts to theory yet.  :)

Regards, 

--jkl