Bug 60696 - /sbin/ifup causes pump and dhcpcd both to run
Summary: /sbin/ifup causes pump and dhcpcd both to run
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts   
(Show other bugs)
Version: 7.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2002-03-04 22:35 UTC by Joe Harrington
Modified: 2014-03-17 02:25 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-05 19:55:54 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Joe Harrington 2002-03-04 22:35:30 UTC
Description of Problem:

A problem in /sbin/ifup causes pump and dhcpcd to run at the same time
if the DHCP server is down.  The pump process then never dies, even
with a network stop.

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


How Reproducible:


Steps to Reproduce:
1. put cable modem in standby (or unplug net, etc.)
2. network restart
3. bring cable modem online
4. network restart
5. ps auxw | egrep 'pump|dhcpcd'

Actual Results:
pump keeps running, and attempting to configure the interface, even if
it is brought up with a static IP.

Expected Results:
On a system with both pump and dhcpcd, pump should never run.
Even if it does run, it should die with network stop.
Pump and dhcpcd should never both run at the same time.

Additional Information:


The problem in pump is that if there is no DHCP server (as in a cable
modem on standby), it goes into the background and hangs around,
refusing to be killed gracefully with pump -r:

# /etc/rc.d/init.d/network start
Setting network parameters:                                [  OK  ]
Bringing up interface lo:                                  [  OK  ]
Bringing up interface eth0:                                [  OK  ]
Bringing up interface eth1:  Determining IP information for eth1... failed.
Operation failed.

# /sbin/pump -r -i eth1
Operation failed.

You can kill it with kill, and that seems ok, except that ifup has the

    if [ -x /sbin/dhcpcd ] && /sbin/dhcpcd ${DHCPCDARGS} ${DEVICE} ; then
	echo $" done."
    elif [ -z "`pidof -x dhcpcd`" ] && [ -x /sbin/pump ] && /sbin/pump
${PUMPARGS} -i ${DEVICE}; then
	echo $" done."
	echo $" failed."
	[ -n "$FWHACK" ] && ipchains -D input -s 0/0 53 -d 0/0 1025:65535 -p udp -j ACCEPT
	exit 1

So, say the cable modem is in standby mode when the user reboots or
restarts the net manually.  It looks for dhcpcd, finds it, tries it,
the cable modem is offline so dhcpcd fails gracefully, it checks that
there is no dhcpcd process, looks for pump, tries it, and after a
minute or two pump goes into the background with an exit status of 1,
not having configured the interface.  The script diddles ipchains and
quits.  But pump lurks in the depths like Gollum, ignoring its
shutdown command because there's no lease to release.

Now the user turns on the modem (this could be a week later) and does
a network restart.  The ifdown script tries to kill pump with -r, not
with kill.  Pump survives as shown above.  Now ifup comes around
again, and looks for and starts dhcpcd.  The dhcpcd program configures
the interface.  Pump lurks.

At some time in the future, pump will decide to try the server again,
unaware that dhcpcd already has done the job.  There is a fight.

There are several things that need to be fixed:

1. pump must not stick around if it returns an exit status of 1.
2. pump must quit if given -r, even if it has not configured the
	interface (or another "really-quit" option needs to be implemented).
3. ifup must not assume that there is not already a daemon running.
4. ifdown must not assume that -r will kill (the current version of) pump.
5. if ifup finds dhcpcd, and dhcpcd fails, it should not try pump.

A quick workaround implements #5:

*** ifup	Sun Mar  3 22:02:50 2002
--- ifup.orig	Wed Feb  6 22:08:54 2002
*** 169,200 ****
! # The following works around a bug in pump that makes it stick around
! # if it tried to get info when there was no dhcp server (e.g., a user's
! # cable modem is turned off).  Here is the original code:
! #    if [ -x /sbin/dhcpcd ] && /sbin/dhcpcd ${DHCPCDARGS} ${DEVICE} ; then
! #	echo $" done."
! #    elif [ -z "`pidof -x dhcpcd`" ] && [ -x /sbin/pump ] && /sbin/pump
${PUMPARGS} -i ${DEVICE}; then
! #	echo $" done."
! #    else
! #	echo $" failed."
! #	[ -n "$FWHACK" ] && ipchains -D input -s 0/0 53 -d 0/0 1025:65535 -p udp -j ACCEPT
! #	exit 1
! #    fi
!     if [ -x /sbin/dhcpcd ]; then
! 	if /sbin/dhcpcd ${DHCPCDARGS} ${DEVICE} ; then
! 	    echo $" done."
! 	else
! 	    echo $" failed."
! 	    failed="true"
! 	fi
      elif [ -z "`pidof -x dhcpcd`" ] && [ -x /sbin/pump ] && /sbin/pump
${PUMPARGS} -i ${DEVICE}; then
  	echo $" done."
  	echo $" failed."
- 	failed="true"
-     fi
-     if [ -n "$failed" ]; then
  	[ -n "$FWHACK" ] && ipchains -D input -s 0/0 53 -d 0/0 1025:65535 -p udp -j ACCEPT
  	exit 1
--- 169,180 ----
!     if [ -x /sbin/dhcpcd ] && /sbin/dhcpcd ${DHCPCDARGS} ${DEVICE} ; then
! 	echo $" done."
      elif [ -z "`pidof -x dhcpcd`" ] && [ -x /sbin/pump ] && /sbin/pump
${PUMPARGS} -i ${DEVICE}; then
  	echo $" done."
  	echo $" failed."
  	[ -n "$FWHACK" ] && ipchains -D input -s 0/0 53 -d 0/0 1025:65535 -p udp -j ACCEPT
  	exit 1

Another quick workaround (less palatable for those who do "everything"
installs for simplicity) is
rpm -e pump

I'll let RH people decide whether to log a separate bug under pump, or to move
this one to that component, or to keep this as an initscripts bug.


Comment 1 Bill Nottingham 2005-04-05 19:55:54 UTC
Closing bugs on older, no longer supported, releases. Apologies for any lack of

Current code only supports dhclient, so this is 'solved' now.

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