Hello Kate:
Are you still experiencing issues with this?
Regards,
Thomas Markwalder
ISC Software Engineering
On Fri Jul 28 18:47:47 2017, tmark wrote:
> On Fri Jul 28 13:38:11 2017, katja@fusionlayer.com wrote:
> > Bug Report from www.isc.org:
> >
> > Name: Kate Andreeva
> > Email: katja@fusionlayer.com
> > Software Version: dhcp-4.3.3-P1
> > OS: CentOS 6
> > Subject:dhcpd.leases file is not rotating
> >
> >
> > Bug Detail
> > ===========
> > File dhcpd.leases is not rotating on regular basis. This causes file
> > growth up go few GBs and dhcpd daemon cannot start because it cannot
> > parse such huge file. As a workaround we changing permissions of
> > "/var/lib/dhcpd/dhcpd.leases" to root:root and restarting dhcpd.
> > System changes permissions to "dhcp:dhcp" and the lease rotation
> > started working.
> >
> > This bug was around for few years (according to community), would be
> > really great to fix it.
> >
> > ---
> > This email was received through isc.org Bug Submission Form
>
> Hello:
>
> Normal operation of dhcpd is to append lease updates to the lease file
> and once per hour recreate the lease, keeping only the most current
> lease information per lease. This interval is hard coded into the
> server. The basic process consists of:
>
> 1. Closing the existing lease file and rename it by appending a "~"
> 2. Opening a new lease file and writing out all of the known leases
>
> All lease updates append to the new lease until the next rewrite, 60
> minutes later.
> So an hour after startup, even with no lease activity, you should see
> <leaese file> and <lease file>~.
>
> This functionality has been part of the server for a very long time.
>
> The server must be started as root because it must be able to open raw
> sockets. By default then the lease file is owned by root. Even if
> something else comes along later and alters ownership of the lease
> file, the server should still be able rewrite the lease file as it is
> running as root.
>
> There is a build configure option, --enable-paranoia, which compiles
> in support for dhcpd command line arguments -user, -group, and -chroot
> (see dhcpd.8). These may be used to allow the server to be started as
> root and later change privileges to those specified by the arguments.
> When this is the case, the lease file will be created and owned by the
> user and/or group specified. Again though, this will not impact lease
> file rewrites as the server's uid/gid still own the lease file.
> Please note that this configure option is off by default.
>
> We would like to see the command line being used to invoke dhcpd.
>
> Could you explain what in the "system" is changing the lease file
> ownership?
>
> Did you compile and install from source or are you running an
> installed package?
>
> Also it would be worthwhile examining the system logs to look for
> errors. You should be able to look for when the server started and
> then at 60 minute intervals in the logs beyond that.