[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ancient date on TiBook (Was: Titanium trackpad blues)



On Thu, Apr 05, 2001 at 05:31:27PM -0500, Kevin van Haaren wrote:
> At 4:28 PM -0700 4/5/01, Jason E. Stewart wrote:
> >It would be sooooooooo.... nice if they did. Every time this happens
> >to me, it kills postgres, because the negative dates corrupt the
> >pg_control file. Luckily I have a spare, uncorrupted one lying around
> >for just such an occasion, but man, the first time it happened I was
> >freaking out. Also sendmail refuses to work. Since I'm only stupid
> >enough to do this about once every three months, I've forgotten that
> >it will happen, and I get really irritated because sendmail is
> >broken.... and then I remember.
> >
> >jas.
> 
> what about an init script that runs just after the network is up, but 
> before postgres, that checks the date and if it's < 2001 force it to 
> 1/1/2001 then run ntpdate to get the real date?

ntpdate runs way to late in the boot process, i would edit its
initscript to add something like this:

if [ `date +%Y` -lt 2001 ] ; then
	date 010100001970
fi

[rest of normal ntpdate script]

this will pull the date up to epoch and then ntpdate should be ok with
updating the time to the correct value, it will require network
connectivity however.  

also 
update-rc.d -f ntpdate remove
update-rc.d -f ntpdate start 41 S .

> just a work around for a poor design, but the best i can think of.

its a hardware flaw which is hard to really fix... only apple can.

-- 
Ethan Benson
http://www.alaska.net/~erbenson/

Attachment: pgpQ4V584uDjX.pgp
Description: PGP signature


Reply to: