[bind10-dev] Storing files by dhcp components

Shane Kerr shane at isc.org
Tue Jan 8 10:09:38 UTC 2013


Tomek,

On Friday, 2013-01-04 15:44:27 +0100, 
Tomek Mrugalski <tomasz at isc.org> wrote:
> Hi,
> DHCPv4 and v6 servers need to store many types of data. The most
> obvious one is lease information. Currently it is stored in MySQL and
> the exact location on filesystem is a matter of MySQL configuration.
> But there are other types of data.
> 
> One notable example is server identifier. That's basically a byte
> array that server generates based on various information (MAC address
> + timestamp in v6 and IPv4 address of the interface in v4) that
> should be consistent between restarts. Typically this is something
> that is generated once and never modified. As this data requires
> special formatting, it is impractical to request user to define it
> using bindctl, especially that we have a working code that generates
> it.
> 
> Which constant should I use as a dir path to such files? If there is
> none, I'd like to add it. What should it point to by default?
> 
> I suppose in typical installation it should be something pointing to
> somewhere in /var (/var/run? /var/db?). As there will be additional
> files there, it makes sense to create specific directory for dhcp4 and
> dhcp6 components. It will be somewhat acceptable if we have one
> directory for the whole bind10, but I would prefer separate
> directories for DHCP and DNS for clarity.
> 
> 
> Another example of data needed to be stored on disk is database file.
> We are using MySQL for now, but it is likely that we will also add
> support for SQLite in the future. It is necessary to specify sqlite
> file location on disk.
> 
> We will also implement memfile backend one day that will store leases
> in a plain text file, similar to isc-dhcp.

It sounds like you are describing the autoconf localstatedir:

http://www.gnu.org/prep/standards/html_node/Directory-Variables.html

You may want to use the same technique as the b10-cfgmgr for this,
which is to take a command-line argument pointing to the correct
directory, which the boss process sets when invoking the program.

Have a look at src/bin/bind10/bind10_src.py.in to see how the boss
starts this, and src/bin/cfgmgr/b10-cfgmgr.py.in to see the b10-cfgmgr
implementation.

Cheers,

--
Shane


More information about the bind10-dev mailing list