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 $? }
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.
in what version is it fixed? I currently have merged the dhcp-3.0.1, but it's still the old one