From adrian@mail.esolstice.com  Mon Jul  3 09:09:45 2000
Return-Path: <adrian@mail.esolstice.com>
Received: from esummer.esolstice.com (esummer.esolstice.com [209.145.65.15])
	by hub.freebsd.org (Postfix) with ESMTP id 10FE137BB4D
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  3 Jul 2000 09:09:36 -0700 (PDT)
	(envelope-from adrian@mail.esolstice.com)
Received: from cluebie.esolstice.int (an-fw.esolstice.com [208.241.63.212])
	by esummer.esolstice.com (8.9.3/8.9.3) with ESMTP id MAA27355
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 3 Jul 2000 12:13:24 -0400 (EDT)
	(envelope-from adrian@mail.esolstice.com)
Received: (from adrian@localhost)
	by cluebie.esolstice.int (8.9.3/8.9.3) id MAA00552;
	Mon, 3 Jul 2000 12:12:41 -0400 (EDT)
	(envelope-from adrian@mail.esolstice.com)
Message-Id: <200007031612.MAA00552@cluebie.esolstice.int>
Date: Mon, 3 Jul 2000 12:12:41 -0400 (EDT)
From: adrian@ubergeeks.com
Sender: adrian@mail.esolstice.com
Reply-To: adrian@ubergeeks.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: dhclient-script not setting hostname after a reboot bug (w/patch)
X-Send-Pr-Version: 3.2

>Number:         19673
>Category:       misc
>Synopsis:       dhclient-script will not always set the hostname after a reboot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 03 09:10:01 PDT 2000
>Closed-Date:    Fri Jan 18 08:14:39 PST 2002
>Last-Modified:  Fri Jan 18 08:16:06 PST 2002
>Originator:     Adrian Filipi-Martin
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
Ubergeeks Consulting
>Environment:

	4-STABLE from 06/29/00.

>Description:

	The first time a system is booted using dhclient, the
	acquired lease information is written to /var/db/dhclient.leases.
	The next time the system is rebooted, dhclient will use
	these values to initialized the old_* variables when running
	the dhclient-script.  If the hostname does not change
	bewteen reboots, the lease file is not removed or the lease
	does not expire, there is a logic bug that will cause
	dhclient to not set the hostname at all.

>How-To-Repeat:

	Do not set hostname in /etc/rc.conf, then boot using DHCP with a
	statically configured hostname/MAC/IP set up on the DHCP server.
	Reboot again and make sure your system recieved the same hostname
	info from the lease as before.  The hostname will not be set even
	though the IP and other info was.

>Fix:

	Apply the the included patch for dhclient-script as follows:

	cd /src/contrib/isc-dhcp/client/scripts
	patch freebsd < /tmp/dhcp-script.diff

	N.B.  Since dhclient is built from contributed sources, I
	am sending the patch to ISC as well so that they can include
	it in the base distribution.

--- dhclient-script.orig	Thu Jun 29 11:45:43 2000
+++ dhclient-script	Mon Jul  3 11:53:19 2000
@@ -78,7 +78,8 @@
   current_hostname=`/bin/hostname`
   if [ x$current_hostname = x ] || \
      [ x$current_hostname = x$old_host_name ]; then
-    if [ x$new_host_name != x$old_host_name ]; then
+    if [ x$new_host_name != x$old_host_name ] || \
+       [ x$new_host_name != x$current_hostname ]; then
       $LOGGER "New Hostname: $new_host_name"
       hostname $new_host_name
     fi


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Tue Jul 4 09:17:42 PDT 2000 
Responsible-Changed-Why:  
DHCP is David's baby. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19673 
Responsible-Changed-From-To: obrien->freebsd-bugs 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Sat Dec 23 11:20:47 PST 2000 
Responsible-Changed-Why:  
I am not the single dhclient maintainer now. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19673 

From: Jordan Hubbard <jkh@osd.bsdi.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: misc/19673
Date: Tue, 27 Mar 2001 14:03:15 -0800

 Well, this one is problematic.  The script lives elsewhere in -current,
 where it's easy to edit, but on the vendor branch in contrib in -stable,
 which I'm loath to take it off.  Any luck in simply getting the ISC to
 accept this change instead?

From: Adrian Filipi-Martin <adrian@ubergeeks.com>
To: Jordan Hubbard <jkh@osd.bsdi.com>,
	<freebsd-gnats-submit@FreeBSD.org>
Cc:  
Subject: Re: misc/19673
Date: Tue, 27 Mar 2001 22:20:43 -0500 (EST)

 > > Jordan Hubbard wrote:
 > >
 > > > The following reply was made to PR misc/19673; it has been noted by GNATS.
 > > >
 > > > From: Jordan Hubbard <jkh@osd.bsdi.com>
 > > > To: freebsd-gnats-submit@FreeBSD.org
 > > > Cc:
 > > > Subject: Re: misc/19673
 > > > Date: Tue, 27 Mar 2001 14:03:15 -0800
 > > >
 > > >  Well, this one is problematic.  The script lives elsewhere in -current,
 > > >  where it's easy to edit, but on the vendor branch in contrib in -stable,
 > > >  which I'm loath to take it off.  Any luck in simply getting the ISC to
 > > >  accept this change instead?
 
 	Sigh.  I did this originally as noted in my original PR.  It seems
 to have disappeared into a black hole.  If someone else with more traction
 with the ISC could get them to do this, that would be great.  Of course
 this probably won't happen before 4.3-RELEASE, so we would be stuck with
 the bug.
 
 	Adrian
 --
 [ adrian@ubergeeks.com ]
 
State-Changed-From-To: open->feedback 
State-Changed-By: mike 
State-Changed-When: Sat Jul 21 21:48:56 PDT 2001 
State-Changed-Why:  

Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE?  If it is, would you mind retrying ISC? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=19673 

From: Mike Heffner <mheffner@novacoxmail.com>
To: mike@FreeBSD.org
Cc: adrian@ubergeeks.com, freebsd-gnats-submit@freebsd.org
Subject: Re: misc/19673: dhclient-script will not always set the hostname
Date: Sun, 22 Jul 2001 13:26:28 -0400 (EDT)

 I believe this was still a problem when I looked at the code.
 
 On 22-Jul-2001 mike@FreeBSD.org wrote:
 | Synopsis: dhclient-script will not always set the hostname after a reboot
 | 
 | State-Changed-From-To: open->feedback
 | State-Changed-By: mike
 | State-Changed-When: Sat Jul 21 21:48:56 PDT 2001
 | State-Changed-Why: 
 | 
 | Does this problem still occur in newer versions of FreeBSD,
 | such as 4.3-RELEASE?  If it is, would you mind retrying ISC?
 | 
 | http://www.FreeBSD.org/cgi/query-pr.cgi?pr=19673
 | 
 | To Unsubscribe: send mail to majordomo@FreeBSD.org
 | with "unsubscribe freebsd-bugs" in the body of the message
 
 
 Mike
 
 -- 
   Mike Heffner         <mheffner@[acm.]vt.edu>
   Fredericksburg, VA       <mikeh@FreeBSD.org>
 

From: Mike Barcroft <mike@FreeBSD.org>
To: Adrian Filipi-Martin <adrian@ubergeeks.com>
Cc: Mike Heffner <mheffner@novacoxmail.com>,
	freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/19673: dhclient-script will not always set the hostname after a reboot
Date: Sun, 22 Jul 2001 16:01:27 -0400

 On Sun, Jul 22, 2001 at 02:59:36PM -0400, Adrian Filipi-Martin wrote:
 > On Sat, 21 Jul 2001 mike@FreeBSD.org wrote:
 > 
 > > Does this problem still occur in newer versions of FreeBSD,
 > > such as 4.3-RELEASE?  If it is, would you mind retrying ISC?
 > >
 > 
 > 	Yes, it definitely does.
 > 
 > 	I'll try again.  Seems like it should be a problem for lots of
 > people, so I'm mystified as to why it hasn't been addressed.
 
 Yes, another person confirmed this is still a bug.  Will you be sure
 to keep us up-to-date on how you make out with ISC?
 
 Best regards,
 Mike Barcroft
State-Changed-From-To: feedback->closed 
State-Changed-By: sheldonh 
State-Changed-When: Fri Jan 18 08:14:39 PST 2002 
State-Changed-Why:  
Automatic feedback timeout.  If additional feedback that warrants 
the re-opening of this PR is available but not included in the 
audit trail, please include the feedback in a reply to this message 
(preserving the Subject line) and ask that the PR be re-opened. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19673 
>Unformatted:
