diff -ru /usr/src/contrib/isc-dhcp/client/clparse.c /home/roderick/src/contrib/isc-dhcp/client/clparse.c --- /usr/src/contrib/isc-dhcp/client/clparse.c Sat Sep 6 11:17:42 2003 +++ /home/roderick/src/contrib/isc-dhcp/client/clparse.c Tue Sep 30 17:37:01 2003 @@ -63,6 +63,7 @@ DHO_DOMAIN_NAME, DHO_DOMAIN_NAME_SERVERS, DHO_HOST_NAME, + DHO_NTP_SERVERS, 0 }; diff -ru /usr/src/contrib/isc-dhcp/client/dhclient-script.8 /home/roderick/src/contrib/isc-dhcp/client/dhclient-script.8 --- /usr/src/contrib/isc-dhcp/client/dhclient-script.8 Thu Jan 16 08:23:57 2003 +++ /home/roderick/src/contrib/isc-dhcp/client/dhclient-script.8 Tue Sep 30 18:03:36 2003 @@ -53,9 +53,11 @@ 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 +user to override the default behaviour of the client in creating .B /etc/resolv.conf -file. +and +.B /etc/ntp.conf +files. .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 @@ -67,15 +69,19 @@ .B ETCDIR/dhclient.conf 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 +When it starts, the client script first defines two shell functions - +.B make_resolv_conf +and +.B make_ntp_conf +- which are later used to create the .B /etc/resolv.conf -file. To override the default behaviour, redefine this function in -the enter hook script. +and +.B /etc/ntp.conf +files respectively. 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 +On after defining the make_resolv_conf and make_ntp_conf functions, 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 @@ -147,7 +153,8 @@ $new_domain_name_servers (which may list more than one server, separated by spaces). A default route should be set using $new_routers, and static routes may need to be set up using -$new_static_routes. +$new_static_routes. In addition, a new /etc/ntp.conf is written out +if $new_ntp_servers contains one or more server entries. .PP If an IP alias has been declared, it must be set up here. The alias IP address will be written as $alias_ip_address, and other DHCP @@ -213,7 +220,7 @@ repeatedly initialized to the values provided by one server, and then the other. Assuming the information provided by both servers is valid, this shouldn't cause any real problems, but it could be -confusing. +confusing. The same goes for /etc/ntp.conf. .SH SEE ALSO dhclient.conf(5), dhclient.leases(5), dhclient(8). .SH AUTHOR diff -ru /usr/src/contrib/isc-dhcp/client/dhclient.conf.5 /home/roderick/src/contrib/isc-dhcp/client/dhclient.conf.5 --- /usr/src/contrib/isc-dhcp/client/dhclient.conf.5 Sat Sep 6 11:17:42 2003 +++ /home/roderick/src/contrib/isc-dhcp/client/dhclient.conf.5 Tue Sep 30 17:37:01 2003 @@ -195,7 +195,7 @@ options. Only the option names should be specified in the request statement - not option parameters. By default, the DHCP server requests the subnet-mask, broadcast-address, time-offset, routers, -domain-name, domain-name-servers and host-name options. +domain-name, domain-name-servers, host-name and ntp-servers options. .PP In some cases, it may be desirable to send no parameter request list at all. To do this, simply write the request statement but specify diff -ru /usr/src/contrib/isc-dhcp/client/scripts/freebsd /home/roderick/src/contrib/isc-dhcp/client/scripts/freebsd --- /usr/src/contrib/isc-dhcp/client/scripts/freebsd Tue Sep 16 03:44:08 2003 +++ /home/roderick/src/contrib/isc-dhcp/client/scripts/freebsd Tue Sep 30 17:37:01 2003 @@ -29,6 +29,25 @@ fi } +make_ntp_conf() { + if [ x"$new_ntp_servers" != x ]; then + ( echo restrict default noquery notrust nomodify >/etc/ntp.conf ) + exit_status=$? + if [ $exit_status -ne 0 ]; then + $LOGGER "WARNING: Unable to update ntp.conf: Error $exit_status" + else + ( echo restrict 127.0.0.1 >>/etc/ntp.conf ) + for ntpserver in $new_ntp_servers; do + ( echo restrict $ntpserver >>/etc/resolv.conf ) + done + for ntpserver in $new_ntp_servers; do + ( echo server $ntpserver >>/etc/resolv.conf ) + done + ( echo driftfile /etc/ntp.drift >>/etc/resolv.conf ) + fi + fi +} + # Must be used on exit. Invokes the local dhcp client exit hooks, if any. exit_with_hooks() { exit_status=$1 @@ -157,6 +176,7 @@ route add $alias_ip_address 127.0.0.1 fi make_resolv_conf + make_ntp_conf exit_with_hooks 0 fi @@ -221,6 +241,7 @@ shift; shift done make_resolv_conf + make_ntp_conf exit_with_hooks 0 fi fi