Bug 60696 - /sbin/ifup causes pump and dhcpcd both to run
/sbin/ifup causes pump and dhcpcd both to run
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-03-04 17:35 EST by Joe Harrington
Modified: 2014-03-16 22:25 EDT (History)
2 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description Joe Harrington 2002-03-04 17:35:30 EST
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):

initscripts-6.43-1

How Reproducible:

always

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:

initscripts-6.43-1
pump-0.8.11-7
dhcpcd-1.3.18pl8-13

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.
                                                           [FAILED]

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

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

    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

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 ****
  	FWHACK=1
      fi
      
! # 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."
      else
  	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
      fi
--- 169,180 ----
  	FWHACK=1
      fi
      
!     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

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.

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

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.