conf/95905: [PATCH] /etc/rc.d/dhclient doesn't interact well with the ports isc dhcp client

Craig Leres leres at
Mon Apr 17 04:00:38 UTC 2006

>Number:         95905
>Category:       conf
>Synopsis:       [PATCH] /etc/rc.d/dhclient doesn't interact well with the ports isc dhcp client
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 17 04:00:31 GMT 2006
>Originator:     Craig Leres
>Release:        FreeBSD 6.1-BETA4 i386
Lawrence Berkeley National Laboratory
	fox 15 % uname -a
	FreeBSD 6.1-BETA4 FreeBSD 6.1-BETA4 #1: Fri Apr 14 01:03:21 PDT 2006     leres at  i386
	fox 16 % pkg_info | grep isc-dhcp3-client
	isc-dhcp3-client-3.0.3_1 The ISC Dynamic Host Configuration Protocol client

	The test in /etc/rc.d/dhclient that is supposed to prevent
	dhclient from being launched if one is already running
	doesn't work with the ports version of dhclient. If you
	have an interface configured for dhcp in /etc/rc.conf,
	dhclient runs and gets a lease normally but then is run
	again later at which point it sets the interface address
	to, ending network access via that NIC.

	Install the isc-dhcp3-client and configure a NIC to use it:


	Then reboot. The interface will come up when dhclient runs.
	Later when it's run again, you'll see this message:

	    Internet Systems Consortium DHCP Client V3.0.3 
	    Copyright 2004-2005 Internet Systems Consortium.
	    All rights reserved.
	    For info, please visit
	    Listening on BPF/em0/00:30:48:00:00:01
	    Sending on   BPF/em0/00:30:48:00:00:01
	    Can't bind to dhcp address: Address already in use
	    Please make sure there is no other dhcp server
	    running and that there's no entry for dhcp or
	    bootp in /etc/inetd.conf.   Also make sure you
	    are not running HP JetAdmin software, which
	    includes a bootp server.

	At this point the original dhclient is still running but
	the interface is misconfigured and you're hosed.

	The simplest solution is to check /var/run/ in
	addition doing the pgrep test that's already in the rc
	script. The appended patch implements this.

	A more complete solution would be to also change the base
	version of dhclient to manage the /var/run/
	file and remove the pgrep test from the rc.d script.

	(If there is interest in that, I'd be happy to generate the

*** dhclient	2006/04/17 02:59:17	1.1
--- dhclient	2006/04/17 03:35:20
*** 27,32 ****
--- 27,42 ----
+ 	# deal with isc dhclient too
+ 	f="/var/run/"
+ 	if [ -s ${f} ]; then
+ 		pid="`cat ${f}`"
+ 		kill -0 "${pid}" >/dev/null 2>&1
+ 		if [ $? -eq 0 ]; then
+ 			exit 0
+ 		fi
+ 	fi
  	if checkyesno background_dhclient; then
  		rc_flags="${rc_flags} -b"

More information about the freebsd-bugs mailing list