c3b67cd
The /etc/dhcp/dhclient.d directory allows other packages and system
c3b67cd
administrators to create application-specific option handlers for dhclient.
c3b67cd
c3b67cd
When dhclient is run, any option listed in the dhcp-options(5) man page can
c3b67cd
be requested.  dhclient-script does not handle every option available
c3b67cd
because doing so would make the script unmaintainable as the components
c3b67cd
using those options might change over time.  The knowledge of how to handle
c3b67cd
those options should be under the responsibility of the package maintainer
c3b67cd
for that component (e.g., NTP options belong in a handler in the ntp
c3b67cd
package).
c3b67cd
c3b67cd
To make maintenance easier, application specific DHCP options can be handled
c3b67cd
by creating a script with two functions and placing it in /etc/dhcp/dhclient.d
c3b67cd
c3b67cd
The script must follow a specific form:
c3b67cd
c3b67cd
(1) The script must be named NAME.sh.  NAME can be anything, but it makes
c3b67cd
    sense to name it for the service it handles.  e.g., ntp.sh
c3b67cd
c3b67cd
(2) The script must provide a NAME_config() function to read the options and
c3b67cd
    do whatever it takes to put those options in place.
c3b67cd
c3b67cd
(3) The script must provide a NAME_restore() function to restore original
c3b67cd
    configuration state when dhclient stops.
c3b67cd
c3b67cd
(4) The script must be 'chmod +x' or dhclient-script will ignore it.
c3b67cd
c3b67cd
The scripts execute in the same environment as dhclient-script.  That means
c3b67cd
all of the functions and variables available to it are available to your
c3b67cd
NAME.sh script.  Things of note:
c3b67cd
c3b67cd
    ${SAVEDIR} is where original configuration files are saved.  Save your
c3b67cd
    original configuration files here before you take the DHCP provided
c3b67cd
    values and generate new files.
c3b67cd
c3b67cd
    Variables set in /etc/sysconfig/network, /etc/sysconfig/networking/network,
c3b67cd
    and /etc/sysconfig/network-scripts/ifcfg-$interface are available to
c3b67cd
    you.
c3b67cd
c3b67cd
See the scripts in /etc/dhcp/dhclient.d for examples.
c3b67cd
cfe00c4
NOTE:  Do not use functions defined in /usr/sbin/dhclient-script.  Consider
c3b67cd
dhclient-script a black box.  This script may change over time, so the
c3b67cd
dhclient.d scripts should not be using functions defined in it.
c3b67cd
c3b67cd
-- 
c3b67cd
David Cantrell <dcantrell@redhat.com>