netreg Revisited
John Hascall
john at iastate.edu
Wed Mar 30 19:04:35 UTC 2011
> John Hascall wrote:
> >
> > Our solution was to modify dhcpd so that it did not write the
> > OMAPI-provoked host entries into the lease file, since we know
> > they will be in the config file the next time dhcpd is restarted.
> >
> John,
> Any chance you have the patch for this? I'd really like to give it a
> try, as we have a very similar warm spare system - though in addition
> ours backs up two masters, one which serves statics only (leases file is
> ignored) and one which serves dynamics.
> IMHO ISC (once again, if anyone's listening) should incorporate the
> patch and add a config file flag to enable it. It would prove very
> useful for those of us who have a established *SQL-backed system but
> just want to add/update hosts without a restart.
>
> -Jason Antman
> Rutgers University, NJ
It's not much of a patch. In the function write_host() in the file
server/db.c do this:
if (!db_printable (host -> name))
return 0;
#ifdef NO_HOSTS_IN_LEASE_FILE
/*
* [ISU] john at iastate.edu 23-Oct-2007
* The line of code below prevents the writing of dynamic
* host entries (those created by OMAPI) from appearing in
* the lease file. They will be present the next time we
* rebuild the config file and restart dhcpd so having them
* written here just makes duplicates.
*/
if (host -> flags & HOST_DECL_DYNAMIC) return 1;
#endif
if (counting)
++count;
And in includes/site.h add this line:
#define NO_HOSTS_IN_LEASE_FILE
Obviously, there would be more work to make this a proper option you
can control from the config file.
John
More information about the dhcp-users
mailing list