the directory of dhcpd.conf and dhcpd.leases

Glenn Satchell Glenn.Satchell at uniq.com.au
Tue Dec 4 12:28:00 UTC 2007


>Subject: the directory of dhcpd.conf and dhcpd.leases
>Date: Tue, 4 Dec 2007 11:54:56 +0800
>
>Hello all
>
>I want to change the directory of dhcpd.conf and dhcpd.leases and put
>these two files into a customized directory (e.g. /tmp).
>
>I modified the dhcpd.h where Default path to dhcpd config files are
>defined
>
>#ifdef DEBUG
>
>#undef _PATH_DHCPD_CONF
>
>#define _PATH_DHCPD_CONF    "/tmp/dhcpd.conf"
>
>#undef _PATH_DHCPD_DB
>
>#define _PATH_DHCPD_DB        "/ tmp/dhcpd.leases"
>
>#undef _PATH_DHCPD_PID
>
>#define _PATH_DHCPD_PID       "/ tmp/dhcpd.pid"
>
>#else
>
>#ifndef _PATH_DHCPD_CONF
>
>#define _PATH_DHCPD_CONF    "/ tmp/dhcpd.conf"
>
>#endif
>
> 
>
>#ifndef _PATH_DHCPD_DB
>
>#define _PATH_DHCPD_DB        "/ tmp/dhcpd.leases"
>
>#endif
>
> 
>
>#ifndef _PATH_DHCPD_PID
>
>#define _PATH_DHCPD_PID       "/ tmp/dhcpd.pid"
>
>#endif
>
>#endif
>
>And I copy manually these two files into the folder '/tmp' and delete
>them in the folder '/usr/sbin/'. Unfortunately, when I ran the program,
>it always said that dhcpd.conf and dhcpd.leases can not be found.
>
>When I copy them back into the '/usr/sbin', the program can run
>successfully!
>
>How could I do to meet my requirements? Which files should be modified?
>
>Thank you for your response to this urgent problem!
>
> 
>
>Best Regards!
>
>DA MING
>
>( 25-84731240-5109 / (Alcanet) 2735-5109
>
>Ming.Da at alcatel-sbell.com.cn
>
> 
You override the directories you want to use by adding them to
site.conf in the lop level of the source directory. No need to modify
includes/site.h. Here is an example, of a variety of variables that can
be defined.

dhcpd.conf is expected to be in the directory ETC, dhcpd.leases in VARDB.

# Put local site configuration stuff here to override the default
# settings in Makefile.conf
USERBINDIR = /usr/local/pkgs/dhcp-3.1.0/bin
BINDIR = /usr/local/pkgs/dhcp-3.1.0/sbin
CLIENTBINDIR = /usr/local/pkgs/dhcp-3.1.0/sbin
ADMMANDIR = /usr/local/pkgs/dhcp-3.1.0/man/man1m
FFMANDIR = /usr/local/pkgs/dhcp-3.1.0/man/man4
LIBMANDIR = /usr/local/pkgs/dhcp-3.1.0/man/man3
USRMANDIR = /usr/local/pkgs/dhcp-3.1.0/man/man1
ETC = /usr/local/etc
VARRUN = /var/run
VARDB = /var/dhcp
LIBDIR = /usr/local/pkgs/dhcp-3.1.0/lib
INCDIR = /usr/local/pkgs/dhcp-3.1.0/include
CC = gcc -O -D_PATH_DHCPD_PID=\"/var/run/dhcpd.pid\"  
-D_PATH_DHCPD_DB=\"/var/dhcp/dhcpd.leases\" 
-D_PATH_DHCPD_CONF=\"/usr/local/etc/dhcpd.conf\"
#CC = gcc -O -DUSE_SOCKETS
# end of local settings

Also you can use the command line:

  dhcpd -cf /tmp/dhcpd.conf -lf /tmp/dhcpd.leases

regards,
-glenn


More information about the dhcp-users mailing list