Currently, you have to wait 5 seconds every time you bring down a dhcpcd-managed interface, so that restarts work. But what could be done instead is to repeatedly call dhcpcd -k until it fails, meaning that there is no more dhcpcd on that interface. Here's a patch to demonstrate: --- /etc/init.d/net.eth0.orig 2003-02-28 13:01:10.000000000 +0000 +++ /etc/init.d/net.eth0 2003-03-12 15:01:04.000000000 +0000 @@ -144,18 +144,15 @@ if [ "$(eval echo \$\{iface_${IFACE}\})" = "dhcp" ] then - /sbin/dhcpcd -k ${IFACE} &>/dev/null - - # Give dhcpcd time to properly shutdown local count=0 - einfon " Waiting for dhcpcd to shutdown" - while [ "${count}" -lt 5 ] - do - echo -n "." + while /sbin/dhcpcd -k ${IFACE} &>/dev/null && [ "${count}" -lt 9 ]; do + # Give dhcpcd time to properly shutdown sleep 1 count=$((count + 1)) done - echo "done" + if [ "${count}" -ge 9 ]; then + eerror "Timed out trying to stop dhcpcd" + fi else /sbin/ifconfig ${IFACE} down >/dev/null fi It works perfectly for me, and I don't see any reason why it wouldn't for anyone else. Reproducible: Always Steps to Reproduce: Actual Results: Now, restarting networks takes only as long as it needs.
Because its usually things 'that work perfectly for me' that blows up in one's face. Get 20 other people to vouch for this, and Ill consider it.
Created attachment 9335 [details, diff] The patch apply this by running 'patch -p0 < [patchfile location]' in /etc/init.d/
Created attachment 9336 [details, diff] Second try :( See above for installation instructions
Works here in FIVE different boxes. Does it count as 5 different users saying: "yes, it works for me too"??? :-)
works here.
Ok, while you guys at it, what do you think about: http://bugs.gentoo.org/show_bug.cgi?id=17162 ? I think however that you could set the timeout option to 15 seconds, and rather make it a default option in /etc/conf.d/net (with some comments) so that its easy to change.
It works for me.
works here
Ok, will be in baselayout-1.8.6.4, thanks.