diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2001-06-24 06:05:12 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2001-06-24 06:05:12 +0000 |
commit | b05a03077c919111a1996bc750b5680d14414c50 (patch) | |
tree | 0e7ff68ba57f076be7c2acba2b531b69f097a762 /usr.sbin/dhcp/dhclient/dhclient-script.8 | |
parent | 31a8df16f90ba9044505180bdd3f03fb36c1ca39 (diff) |
dhcp 2.0pl5 merge/cleanup/deadcode slashing. still needs more eyes on this
but appears to work better than what's been in-tree before for dealing with
stupid dhcp servers.
Diffstat (limited to 'usr.sbin/dhcp/dhclient/dhclient-script.8')
-rw-r--r-- | usr.sbin/dhcp/dhclient/dhclient-script.8 | 61 |
1 files changed, 47 insertions, 14 deletions
diff --git a/usr.sbin/dhcp/dhclient/dhclient-script.8 b/usr.sbin/dhcp/dhclient/dhclient-script.8 index 42f79a131fa..82212db6cf6 100644 --- a/usr.sbin/dhcp/dhclient/dhclient-script.8 +++ b/usr.sbin/dhcp/dhclient/dhclient-script.8 @@ -35,7 +35,7 @@ .\" Enterprises. To learn more about the Internet Software Consortium, .\" see ``http://www.isc.org/isc''. To learn more about Vixie .\" Enterprises, see ``http://www.vix.com''. -.TH dhclient 8 +.TH dhclient-script 8 .SH NAME dhclient-script - DHCP client network configuration script .SH DESCRIPTION @@ -47,15 +47,49 @@ interface's final configuration once a lease has been acquired. If no lease is acquired, the script is used to test predefined leases, if any, and also called once if no valid lease can be identified. .PP -This script is not meant to be customized by the end user. However, -the script may not work on particular versions of particular operating -systems (indeed, no standard script exists for some operating -systems), so a pioneering user may well need to create a new script or -modify an existing one. In general, customizations specific to a -particular computer should be done in the -.B /etc/dhclient.conf -script. If you find that you can't make such a customization without -customizing dhclient.conf, please submit a bug report. +This script is not meant to be customized by the end user. If local +customizations are needed, they should be possible using the enter and +exit hooks provided (see HOOKS for details). These hooks will allow the +user to override the default behaviour of the client in creating a +.B /etc/resolv.conf +file. +.PP +No standard client script exists for some operating systems, even though +the actual client may work, so a pioneering user may well need to create +a new script or modify an existing one. In general, customizations specific +to a particular computer should be done in the +.B ETCDIR/dhclient.conf +file. If you find that you can't make such a customization without +customizing +.B dhclient-script +or using the enter and exit hooks, please submit a bug report. +.SH HOOKS +When it starts, the client script first defines a shell function, +.B make_resolv_conf , +which is later used to create the +.B /etc/resolv.conf +file. To override the default behaviour, redefine this function in +the enter hook script. +.PP +On after defining the make_resolv_conf function, the client script checks +for the presence of an executable +.B ETCDIR/dhclient-enter-hooks +script, and if present, it invokes the script inline, using the Bourne +shell '.' command. The entire environment documented under OPERATION +is available to this script, which may modify the environment if needed +to change the behaviour of the script. If an error occurs during the +execution of the script, it can set the exit_status variable to a nonzero +value, and +.B ETCDIR/dhclient-script +will exit with that error code immediately after the client script exits. +.PP +After all processing has completed, +.B ETCDIR/dhclient-script +checks for the presence of an executable +.B ETCDIR/dhclient-exit-hooks +script, which if present is invoked using the '.' command. The exit status +is passed in the exit_status shell variable, and will always be zero if the +script succeeded at the task for which it was invoked. .SH OPERATION When dhclient needs to invoke the client configuration script, it writes a shell script into /tmp which defines a variety of variables. @@ -89,7 +123,7 @@ no examples exist yet. The IP address to check is passed in $new_ip_address, and the interface name is passed in $interface. .SH ARPCHECK The DHCP client wants to know if a response to the ARP request send -using ARPCHECK has been received. If one has, the script should exit +using ARPSEND has been received. If one has, the script should exit with a nonzero status, indicating that the offered address has already been requested and should be declined. $new_ip_address and $interface are set as with ARPSEND. @@ -107,9 +141,8 @@ When a binding has been completed, a lot of network parameters are likely to need to be set up. A new /etc/resolv.conf needs to be created, using the values of $new_domain_name and $new_domain_name_servers (which may list more than one server, -separated by spaces). If /etc/resolv.conf.tail exists, it is appended -to the newly-created /etc/resolv.conf file. A default route should -be set using $new_routers, and static routes may need to be set up using +seperated by spaces). A default route should be set using +$new_routers, and static routes may need to be set up using $new_static_routes. .PP If an IP alias has been declared, it must be set up here. The alias |