Re: [Dnsmasq-discuss] patch proposal: getent support for ethers

2009-06-26 Thread Justin McAteer
Gents,

We are wanting to do some database integration with dnsmasq here as
well. I saw there was a patch that provided MySQL support for 2.20,
but it has not been maintained. Also, there was another patch
mentioned elsewhere (I believe against a newer version), but it is not
available.

I have considered doing some type of FIFO with the text files and a
script as well, but I am afraid that type of solution may be too
fragile for my deployment environment.

Does anyone have any insight into what the issues with the previous
MySQL patch was, or if there are any good shortcuts to getting basic
database integration into dnsmasq?

Cheers,
Justin McAteer





On Thu, Jun 25, 2009 at 7:10 PM,
richardvo...@gmail.comrichardvo...@gmail.com wrote:
 Many people have asked for a DHCP server with LDAP support, but nobody
 make that happen (at least, not with dynamic updates).

 I've implemented dynamic update of static IP assignments from an SQL
 server with no changes needed to the dnsmasq code.  While your method
 should work, it definitely won't be efficient.  Since DHCP is a
 polling protocol, requests have to be more frequent than updates
 almost by definition (the lease-time must be set short in case of
 dynamic updates, or the client won't see the new settings).

 I accomplished this by making /etc/ethers a pipe connected to a perl
 script which reads all assignments from the database.  Happily I am
 using postgresql which allows clients to be notified of table updates,
 so I have another perl script which waits for an update and signals
 the dnsmasq process to re-read /etc/ethers.

 I think you could set up something similar for your environment.

 I guess if the number of assignments in the database is far larger
 than the number of simultaneously connected clients then querying the
 database per-request might be better than transferring the entire
 database after each change.  I don't know if the dbus interface would
 allow updating individual assignments.

 ___
 Dnsmasq-discuss mailing list
 Dnsmasq-discuss@lists.thekelleys.org.uk
 http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss




Re: [Dnsmasq-discuss] patch proposal: getent support for ethers

2009-06-26 Thread Simon Kelley

Justin McAteer wrote:

Gents,

We are wanting to do some database integration with dnsmasq here as
well. I saw there was a patch that provided MySQL support for 2.20,
but it has not been maintained. Also, there was another patch
mentioned elsewhere (I believe against a newer version), but it is not
available.

I have considered doing some type of FIFO with the text files and a
script as well, but I am afraid that type of solution may be too
fragile for my deployment environment.

Does anyone have any insight into what the issues with the previous
MySQL patch was, or if there are any good shortcuts to getting basic
database integration into dnsmasq?

Cheers,
Justin McAteer



There's already code which allows a running dnsmasq process to re-read 
dhcp-host-like configuration from a file when dnsmasq sees a signal.


There's already a DBus control interface.

An addition  of  DBus methods which allow dhcp-host-like configuration 
to be supplied would seem to be a winner for this, IMHO.


That handles configuration: for storing the lease database, the 
dhcp-script and leasefile-ro options already allow an arbitrary database 
to replace the leases file. It's been used by DD-WRT to keep the leases 
in NVRAM, the scripts are in /contrib.




Cheers,

Simon.