/etc/init.d/net.eth0 in stop() calls dhcpcd -k after doing the ifconfig down. This always causes an error message by dhcpcd that the interface is already down. Another problem is that dhcpcd does not stop, so you get a dhcpcd was sent a TERM warning on shutdown. Is there any way to prevent this? I'm not sure how this is supposed to work, so I'm not sure what should be done to fix it. Is dhcpcd supposed to save its cached IP? If so, you don't want the dhcpcd -k at all. If it is not supposed to save the IP, the order of dhcpcd -k and ifconfig down needs to be switched.
Az: looks like the dhcpcd thing was right before I applied that fix from ??? (jnelson? can't remember)
Ok, here goes. I do not use DHCP, and do not have fasilities to test it. Also, we have been getting so many "fixes" for this, it is starting to get redicioulus, and whatever I am going to change it to, *needs* to be correct! Look at net.eth0: ------------------------------------------------------------- /sbin/ifconfig ${IFACE} down &>/dev/null if [ "$(eval echo \$\{iface_${IFACE}\})" == "dhcp" ] then /sbin/dhcpcd -k ${IFACE} &>/dev/null fi -------------------------------------------------------------- Above is the lines you are interested in. 1) Does ifconfig ${IFACE} down need to be called for DHCP ? 2) If so, should it be after dhcpcd -d ? So, should it be: --------------------------option A ---------------------------- if [ "$(eval echo \$\{iface_${IFACE}\})" == "dhcp" ] then /sbin/dhcpcd -k ${IFACE} &>/dev/null else /sbin/ifconfig ${IFACE} down &>/dev/null fi --------------------------------------------------------------- or -------------------------Option B------------------------------ if [ "$(eval echo \$\{iface_${IFACE}\})" == "dhcp" ] then /sbin/dhcpcd -k ${IFACE} &>/dev/null fi /sbin/ifconfig ${IFACE} down &>/dev/null ---------------------------------------------------------------- Please test, verify, etc, and let me know, thanks.
1 - Does ifconfig ${IFACE} down need to be called for DHCP ? ifconfig down needs to NOT be called before dhcpcd -k. Otherwise it gets: * Bringing eth0 down... dhcpcd[###]: dhcpRelease: sento: Network is down dhcpcd[###]: arpRelease: sento: Network is down Strangely, this error only occurs in net.eth0 during shutdown. If you run it from bash, no errors occur. Since the error makes sense, I have no idea why you don't get it when running from bash. 2 - If so, should ifconfig be after dhcpcd -d ? I assume "-d" is a typo. You mean "-k", right? dhcpcd -k also takes down the interface, when it is ready. However, dhcpcd -k does not wait for that to happen; it only sends a signal to the running copy of dhcpcd. 3 - option A/B: I think A is correct. However, it probably needs a delay after dhcpcd -k. Can you wait 10 seconds or until the currently running dhcpcd (not the -k copy) terminates? 4 - The other warning I got: * Sending all processes the TERM signal... dhcpcd[###]: terminating on signal 15 I think this is because everything is going too fast. dhcpcd takes awhile to communicate with the DHCP server. When it is finished, it takes down eth0. However, dhcpcd -k does not wait for this, so net.eth0 continues on. When the shutdown script gets to the TERM section, dhcpcd is still running. Can you confirm any of this?
Yep, typo. So can you confirm that option A works for you ? Btw, things are a bit speedy. Add a sleep 5, or so to the if dhcp statemend in stop(), and see if that helps.
Option A with sleep works. It now says dhcpcd terminating with signal 1. That's SIGHUP, which is how dhcpcd is supposed to terminate. I would prefer dhcpcd not say anything, but I don't think that is possible. Here is what I have: if [ "$(eval echo \$\{iface_${IFACE}\})" == "dhcp" ] then /sbin/dhcpcd -k ${IFACE} &>/dev/null sleep 5 else /sbin/ifconfig ${IFACE} down &>/dev/null fi
Ok, fixed on CVS, should be in next baselayout. Sorry for delay, sorda mislayed changes.