Bug 46942 - Startup and shutdown scripts for dhcpcd are wrong
Summary: Startup and shutdown scripts for dhcpcd are wrong
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
: 53670 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-07-02 12:12 UTC by Steven W. Orr
Modified: 2014-03-17 02:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-08-09 05:43:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Steven W. Orr 2001-07-02 12:12:40 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.7 [en] (X11; I; SunOS 5.7 sun4u)

Description of problem:
dhcpcd is stopped when you do a network stop command. network calls ifdown
which kills dhcpcd by calling dhcpcd -k. The -k option sends dhcpcd a
SIGHUP which causes the lease on the IP address to be released. This is
wrong. Instead it should be sent a SIGTERM so that the cache info for the
lease is retained.

Also, the ifup script does not allow the user to specify additional options
to dhcpcd.

How reproducible:
Always

Steps to Reproduce:
1.service network stop
2.
3.
	

Actual Results:  dhcpcd was killed with a SIGHUP instead of a SIGTERM.

Expected Results:  dhcpcd should have saved its information about its
current lease so that on next startup it would ask for its old lease.

Additional info:

A possible fix for ifdown:

 ifdown should *not* do a
                dhcpcd -k ${DEVICE}
   instead it should do a
                kill -15
   The associated fragment should look lsomething like this:
        dhcpcdPid=$(pidof -x dhcpcd)
        [ -n "${dhcpcdPid}" ] && {
                kill -15 ${dhcpcdPid}
                retcode=$?
        }

ifup should look like this instead of what it currently does.
(The initial value for DHCPCDASRGS are my customizations.)


if [ -n "${DYNCONFIG}" ]; then
    PUMPARGS=
    DHCPCDARGS='-d -R' # My example additional flags.
    if [ -n "${DHCP_HOSTNAME}" ]; then
       PUMPARGS="-h ${DHCP_HOSTNAME}"
       DHCPCDARGS="${DHCPCDARGS} -h ${DHCP_HOSTNAME}"

Comment 1 Michael Meissner 2001-07-13 02:45:31 UTC
One reason for having additional arguments to dhcpd is one I just ran into.  In
setting up my new fractional T1, I needed to install a Linux box as the router
and firewall.  Like the more popular cable modems and DSL setups, there is an
ethernet connection from the Wan and of course the local network.  You don't
want to run dhcpd on the external network, but you do want to run it on the
internal networks (in my case, I have two disjoint local networks, and the
firewall box has 3 ethernet cards).  You don't want to hack the Red Hat provided
script, since that won't survive any upgrades.

Comment 2 Bill Nottingham 2001-08-09 05:45:01 UTC
Fixed in 6.13-1 (both using kill -15, and also using any DHCPCDARGS/PUMPARGS in
the environment (so they can be set in the ifcfg files.)


Comment 3 Bill Nottingham 2005-01-06 22:46:06 UTC
*** Bug 53670 has been marked as a duplicate of this bug. ***


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