Bug 120093 - dhclient dies if it doesn't get an answer from the dhcp server
dhclient dies if it doesn't get an answer from the dhcp server
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: dhcp (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jason Vas Dias
Depends On:
  Show dependency treegraph
Reported: 2004-04-05 17:45 EDT by Bill Peck
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: initscripts-7.61
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-11 10:58:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2004:566 normal SHIPPED_LIVE Updated dhcp and dhclient packages 2005-05-26 00:00:00 EDT

  None (edit)
Description Bill Peck 2004-04-05 17:45:35 EDT
Description of problem:
The dhclient will die if the dhcp server is not available when it goes
to renew its lease.  So when the dhcp server does come back up it
won't recover.

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

How reproducible:

Steps to Reproduce:
1. start dhcp server
2. start up a dhcp client machine
3. confirm that network comes up with an ip served from server
4. stop dhcp server
5. after lease time dhclient will fail and die.

Actual results:
dhclient dies

Expected results:
dhclient should not die and restore the IP address when the dhcp
server is available again.

Additional info:
Comment 1 Jason Vas Dias 2004-08-11 10:58:20 EDT
When a lease expires, dhclient is meant to try its 
DHCPDISCOVER until it fails for a 'timeout' parameter, 
configurable in dhclient.conf (default 1 minute).

If this timeout expires, it will attempt to reuse any previous
unexpired leases, and if there are none, by default it will sleep
for a 'retry' interval, configurable in dhclient.conf 
(default 5 minutes) and begin its DHCPDISCOVER again - 
UNLESS the '-1' one-time option was specified on the command line, 
in which case it just gives up and exits.

It seems that the /sbin/ifup script always invokes dhclient
with the '-1' 'one-time' option:

/sbin/ifup, line 248:
if [ -n "${DYNCONFIG}" ]; then
/var/lib/dhcp/dhclient-${DEVICE}.leases -pf
/var/run/dhclient-${DEVICE}.pid -cf /etc/dhclient-${DEVICE}.conf"

and this is hardcoded, not configurable.

Without this option, if the dhcp server does not respond, dhclient
will sleep and retry forever until it does; with it, dhclient gives
up the first time the server does not respond for the timeout.

For dhcp clients that are meant to run unattended, and which depend
on a dhcp server that may be temporarily down for maintenance, this
would be nice behavior; otherwise the operator has to manually run
ifup again on all the clients.

So, there will now be a "PERSISTANT_DHCLIENT" option allowed in 
If set to a value beginning with 'y', 'Y', or '1', then 
the '-1' option will be omitted from the dhclient options for that
interface; else it will be included (the default).
This will be in initscripts-7.61-1 .

Comment 2 Dax Kelson 2004-08-12 13:23:03 EDT
To be consistent with other ifcfg-* options, you should also allow for
"yes" and "YES".

Question though, why have the -1 option be there by default?  That
seems counter intuitive makes RHEL/FC behave differently than Windows
or SUSE.
Comment 3 Jason Vas Dias 2004-08-12 13:35:25 EDT
"YES" "yes" "Yes" "yEs" "y" "Y" "1", etc. will all enable the option -
this is just for convenience - I guess maybe it should handle "on" too.

It is not the default because otherwise, if no DHCP server responds 
during boot up, the 'service network start' will hang indefinitely
waiting for a response from the DHCP server. This is what the operator
of an unattended rackmount server would want, but not what the
"average" user would want.  
Comment 4 John Flanagan 2004-12-21 14:42:04 EST
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.

Comment 5 Robert Clark 2005-04-11 09:45:55 EDT
This isn't yet fixed in RHEL3. Advisory RHBA-2004:566-10 lists this bug as fixed
for RHEL3, but only includes updated dhcp & dhclient packages. The
PERSISTENT_DHCLIENT fix is in initscripts and the most recent initscripts for
RHEL3 is 7.31.18.EL-1 which doesn't include this.

Note You need to log in before you can comment on or make changes to this bug.