Problem:
I want to change the timeout of dhclient for embedded Linux that doesn’t have DHCP.
What I did:
I have compiled DHCP from isc.org. I have compiled it with this CFLAGS:
CFLAGS="-D_PATH_DHCLIENT_SCRIPT='\"/sbin/dhclient-script\"' \
-D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \
-D_PATH_DHCLIENT_CONF='\"/ISGv2/configs/dhclient.conf\"'"
In my config file, /ISGv2/configs/dhclient.conf
(which I designated as _PATH_DHCLIENT_CONF
in my CFLAGS, shown above),
I have specified a timeout of 3 seconds.
If I execute this command:
dhclient wlan0
It uses a timeout of <something other than 3 seconds>, so it must be reading the "defaults" settings from some other (unknown) config file.
If I execute this command:
dhclient wlan0 -cf /ISGv2/configs/dhclient.conf
it works as expected.
How can I determine what config file it is using by default?
dhclient
or did it come from your distribution?isc-dhcp
before compilation. So no one can answer that except you. A typical location is/etc/dhcp/dhclient.conf
. The option-pf
gives a path to a file where it stores the pid, so it's easy for the system to find it later. This file has nothing to do with the config file./var/run/dhclient.wlan0.pid
or not? If not, delete it from the title. (2) Have you tried usingstrace
to see what files it accesses?