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