summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2003-07-26 18:50:53 +0000
committermtm <mtm@FreeBSD.org>2003-07-26 18:50:53 +0000
commitbfb4dcf217a83be6b55dd25939df0c858f065121 (patch)
tree1ae71827972e81c2d2ab2b0bd0680445f7a34055 /etc/rc.d
parent2cb639738f04d06b9b9dca3077f6943a098f11ea (diff)
downloadFreeBSD-src-bfb4dcf217a83be6b55dd25939df0c858f065121.zip
FreeBSD-src-bfb4dcf217a83be6b55dd25939df0c858f065121.tar.gz
When stopping a dhcp interface, don't just release the lease on
the address, also kill the dhclient process. Instead of doing the release in the stop command, move it to the precmd stage and allow rc.subr(8) to automatically kill the dhclient process by leaving the stop command undefined. Noticed by: mbr
Diffstat (limited to 'etc/rc.d')
-rwxr-xr-xetc/rc.d/dhclient19
1 files changed, 7 insertions, 12 deletions
diff --git a/etc/rc.d/dhclient b/etc/rc.d/dhclient
index 71d7c41..19b5f2e 100755
--- a/etc/rc.d/dhclient
+++ b/etc/rc.d/dhclient
@@ -23,7 +23,6 @@ FreeBSD)
rcvar=
start_precmd="dhclient_prestart"
start_postcmd="dhclient_poststart"
- stop_cmd="dhclient_stop"
stop_precmd="dhclient_prestop"
stop_postcmd="dhclient_poststop"
;;
@@ -73,8 +72,14 @@ dhclient_poststart()
done
}
-dhclient_stop()
+dhclient_prestop()
{
+ dhclient_common || return 1
+
+ for ifn in ${_cooked_list}; do
+ ipx_down ${ifn}
+ ifalias_down ${ifn}
+ done
echo -n "Releasing DHCP leases:"
for ifn in $_cooked_list ; do
${command} -r $ifn
@@ -88,16 +93,6 @@ dhclient_stop()
debug "The following leases failed to release: $_fail"
}
-dhclient_prestop()
-{
- dhclient_common || return 1
-
- for ifn in ${_cooked_list}; do
- ipx_down ${ifn}
- ifalias_down ${ifn}
- done
-}
-
dhclient_poststop()
{
for ifn in ${_cooked_list}; do
OpenPOWER on IntegriCloud