Subject: Re: "corrupt
To: Jun-ichiro itojun Hagino <itojun@iijlab.net>
From: Tom Ivar Helbekkmo <tih@eunetnorge.no>
List: tech-net
Date: 05/06/2004 08:23:11
Jun-ichiro itojun Hagino <itojun@iijlab.net> writes:

> 	even though i always stop dhclient by "dhclient -r", i get "corrupt
> 	lease file" error.  the error persists even if i remove the lease file
> 	before invocation of dhclient (i see the error message starting from
> 	2nd invocation).  any clues?

I've been slightly irritated by that message, too, and I've peeked at
the /var/run/dhclient.leases file from time to time.  It looks to me
as if the file is overwritten instead of rewritten when a new set of
leases is stored there, because the file has a number of still valid
leases at the top, and then a number of outdated ones, of which the
first is incomplete -- a random amount of the start of the record is
overwritten.

I'd look for a missing O_TRUNC, or a failing truncate(), or something.

-tih
-- 
Tom Ivar Helbekkmo, Senior System Administrator, EUnet Norway
www.eunet.no  T: +47-22092958 M: +47-93013940 F: +47-22092901