Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 48207 - dhcrelay daemon init.d file is wrong: won't stop the daemon
Summary: dhcrelay daemon init.d file is wrong: won't stop the daemon
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Max Kalika (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-18 05:08 UTC by Niels Laukens
Modified: 2005-01-01 11:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Niels Laukens 2004-04-18 05:08:12 UTC
The initfile of dhcrelay (ebuild net-misc/dhcp) is wrong:
* dhcrelay doesn't save it's own pid file
* dhcrelay with more than 1 interface should be called as "dhcrelay -i eth0 -i eth1"

Reproducible: Always
Steps to Reproduce:
1. use more than 1 interface
2. start the daemon (won't start cause command line error)
3. if he is started, try stopping




this version does work (with me) :

---- snip ----

checkconfig() {
        ifaces="$(echo $IFACE | sed 's/ / -i /')"
}

start() {
        checkconfig
        ebegin "Starting dhcrelay"
        start-stop-daemon --start --quiet --background \
                --pidfile /var/run/dhcp/dhcrelay.pid --make-pidfile \
                --exec /usr/sbin/dhcrelay \
                -- -q -d -i ${ifaces} ${DHCRELAY_OPTS} \
                ${DHCRELAY_SERVERS}
        eend $?
}

stop() {
        ebegin "Stopping dhcrelay"
        start-stop-daemon --stop --quiet --pidfile /var/run/dhcp/dhcrelay.pid
        rm /var/run/dhcp/dhcrelay.pid
        eend $?
}
Comment 1 Max Kalika (RETIRED) gentoo-dev 2004-12-20 11:24:11 UTC
Fixed, though differently than what you suggested.  The problem with your sed line is that if there's more than one space between interface names, you get spurrious -i flags.  Further, the .pid is created already in /var/run so no need to have another lying about -- just point to it in stop().

Give it a whirl and post your findings.
Comment 2 Niels Laukens 2005-01-01 11:47:09 UTC
in what version is it fixed?
I currently have merged the dhcp-3.0.1, but it's still the old one