Bug 170779

Summary: dhclient-script problems found & fixed
Product: Red Hat Enterprise Linux 4 Reporter: Jason Vas Dias <jvdias>
Component: dhcpAssignee: Jason Vas Dias <jvdias>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: poelstra, sundaram
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2006-0114 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-07 18:15:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 144417    
Bug Blocks: 168429    

Description Jason Vas Dias 2005-10-14 15:13:36 UTC
+++ This bug was initially created as a clone of Bug #144417 +++

Description of problem:

During DHCP testing, these problems with dhclient script were
found and fixed:

1. Interface & resolv.conf configured and services restarted
   in wrong order
  
   Before, when a new lease is to be configured, dhclient-script 
   potentially restarted the ntpd and ypbind services BEFORE the
   new interface and resolv.conf were configured, leading to long
   timeouts for these services .  

   Now, dhclient-script will follow this order when a new lease
   is being configured:
  
   1. (re-)Configure the interface and routes
   2. configure resolv.conf
   3. potentially restart ntpd and ypbind
  
   (It used to follow the REVERSE of this order).

2. Files that were reconfigured by DHCP when an new lease is 
   configured (ifup) were not restored to previous versions 
   when the lease is relinquished (ifdown).

   dhclient-script can potentially configure these files,

     /etc/resolv.conf
     /etc/yp.conf
     /etc/ntp.conf
     /etc/ntp/step-tickers
   
   It always has backed these up to ${FILE}.predhclient copies
   and then created the new ${FILE} when an new lease is configured
   (ifup); however, when the lease is relinquished (ifdown) it was
   not restoring these backup copies (it now does) .

3. NTP configuration :
   The default /etc/ntp.conf file as distributed with the ntp package
   was not preserved; dhclient-script used to write its own ntp.conf
   file containing ntp configuration statements that were out of 
   date (eg. 'authenticate  yes'), and removing server entries for
   local clocks.

   Now dhclient-script changes ONLY the server entries, removing 
   any server entries EXCEPT THE LOCAL CLOCK, and adding new DHCP
   ntp server values, writing all server values to
   /etc/ntp/step-tickers .   
  
   Both /etc/ntp.conf and /etc/ntp/step-tickers are backed up and the
   ntp server is restarted with the new files; the 
   ntp.conf.predhclient  and /etc/ntp/step-tickers.predhclient are
   restored and ntp restarted again when the lease is relinquished
   (ifdown).

4. NIS configuration:

   ypbind was not being told to reload /etc/yp.conf when a new 
   /etc/yp.conf was written by dhclient, so changes made by dhclient
   to the yp configuration could never take effect unless the server
   is manually restarted.

   Now, when dhclient-script changes yp.conf, if ypbind is running
   after yp.conf is changed, dhclient-script  sends ypbind a SIGHUP
   signal to reload yp.conf. If ypbind is not running, and ypbind
   is configured for the current runlevel, ypbind will be started up.
   If the yp.conf file becomes empty of any 'domain' or 'ypserver'
   entries, and ypbind gets a SIGHUP, it will shut itself down; so
   if the default yp.conf file before dhclient runs is empty, then
   ypbind will be automatically started when a lease is acquired, and
   shut down when the lease is relinquished.

5. A related problem (also related to bug #143704) was that during 
   an ifdown, dhclient did not release the lease ; now that dhclient 
   is fixed to properly shut down the dhclient run by ifup if invoked
   in -r mode, the /sbin/ifdown script will invoke dhclient -r to 
   release the lease, so that the '*.predhclient' files will be 
   restored when an 'ifdown' occurs .

  
Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

-- Additional comment from jvdias on 2005-01-13 10:21 EST --
Fixed in:
 FC4:    dhcp-3.0.2rc3-1+
 FC3:    dhcp-3.0.1-30_FC3+
       + initscripts-8.0.3+

Comment 1 Jason Vas Dias 2005-10-14 15:14:41 UTC
fixed with dhcp-3.0.1-40_EL4+

Comment 7 Red Hat Bugzilla 2006-03-07 18:15:26 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0114.html