Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Nov 2005 09:39:50 -0800 (PST)
From:      Luke Dean <LukeD@pobox.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: dhclient.leases grows forever?
Message-ID:  <20051115092808.C53984@border.crystalsphere.multiverse>
In-Reply-To: <20051114093334.N5133@border.crystalsphere.multiverse>
References:  <20051114093334.N5133@border.crystalsphere.multiverse>

next in thread | previous in thread | raw e-mail | index | archive | help


On Mon, 14 Nov 2005, Luke Dean wrote:

>
> I've recently upgraded to version 6, and I'm using the new dhclient.
> It seems to be working happily, but I've noticed that 
> /var/db/dhclient.leases.rl0 just keeps growing and growing, with new leases 
> being added to the end.  Leases that expired several hours ago remain in the 
> file.
>
> According to the manpage for dhclient.leases, this database is supposed to 
> contain only leases that are "still valid", yet the expiration time on many 
> of them has long since passed.
>
> Is there a bug, a misconfiguration, or am I responsible for setting up my own 
> script for purging this thing?  I can't find any cron-driven script that 
> cleans up this file, so I'm wondering if dhclient is supposed to handle this 
> itself, and if so, when?

I haven't gotten any replies to this, but now that more time has passed I 
see that dhclient is cycling the contents of the leases file.  There's 
about twenty leases in there all the time.  Some of them have expired and 
some are planned many hours out into the future.  I don't know when it 
cycles the leases or what the meaning of the far-future leases are, but 
it's working and cleaning up after itself somehow, so I'll shut up now.

If somebody would like to explain how dhclient cycles through these leases 
though, I'd appreciate it.  The manpages aren't enough to make me 
understand the process.

I do have one practical reason for wanting to understand this.  When I 
need to take the server down for maintenance, I like to know when my IP 
lease is due to expire.  This lets me know how much time I can be 
offline before I lose my IP address.  With the old dhclient that only had 
one lease in the file, the answer was obvious.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051115092808.C53984>