Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 2175 - net.eth0 dhcpcd shutdown warnings/errors
Summary: net.eth0 dhcpcd shutdown warnings/errors
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-27 22:03 UTC by Noah Gintis
Modified: 2003-02-04 19:42 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 Noah Gintis 2002-04-27 22:03:50 UTC
/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.
Comment 1 Daniel Robbins (RETIRED) gentoo-dev 2002-04-28 02:06:10 UTC
Az: looks like the dhcpcd thing was right before I applied that fix from ???
(jnelson? can't remember)
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-04-28 03:10:24 UTC
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.

Comment 3 Noah Gintis 2002-04-28 13:18:48 UTC
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?
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-04-29 14:36:33 UTC
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.
Comment 5 Noah Gintis 2002-05-01 14:22:21 UTC
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
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2002-05-10 16:52:00 UTC
Ok, fixed on CVS, should be in next baselayout.  Sorry for delay, sorda
mislayed changes.