Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 155760 - /etc/init.d/net.lo should detect the absense of a network cable and fail before dhcp is started.
Summary: /etc/init.d/net.lo should detect the absense of a network cable and fail befo...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-20 05:50 UTC by Philippe Chaintreuil
Modified: 2006-11-20 09:06 UTC (History)
1 user (show)

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 Philippe Chaintreuil 2006-11-20 05:50:25 UTC
As a Gentoo laptop user, I find it lightly annoying that when no cable is plugged into my network port, I get to DHCP and have to wait for the timeout during boot.

It would be nice, if similar to the way that wireless interfaces detect that there are no access points and therefore doesn't try to run DHCP, the wired portion of /etc/init.d/net.lo would notice the absence of a wire and fail earlier.
Comment 1 Philippe Chaintreuil 2006-11-20 05:54:48 UTC
Issues I immediately start to wonder about.

1.)  Is the RUNNING flag issued by /sbin/ifconfig enough to go on?  I just noticed that it goes away if I stop my wired network card.  Is there another way to detect if the ethernet cable is plugged in or not from software?  Bringing up the card with a static IP and checking?
2.)  Does this only effect DHCP or should it effect static IP's too?
Comment 2 Roy Marples (RETIRED) gentoo-dev 2006-11-20 06:51:28 UTC
(In reply to comment #1)
> 1.)  Is the RUNNING flag issued by /sbin/ifconfig enough to go on?

No.
Quite a few drivers don't report link status correctly, so we don't do this by default in baselayout.

However, baselayout will use either netplugd or ifplugd by default if installed to bring the interface up/down depending on link status as reported by the kernel driver. Again, some drivers don't work correctly with this. If yours does not, please file a kernel bug.

Re-open if you disagree
Comment 3 Philippe Chaintreuil 2006-11-20 07:00:35 UTC
(In reply to comment #2)
> However, baselayout will use either netplugd or ifplugd by default if installed
> to bring the interface up/down depending on link status as reported by the
> kernel driver.

   Wait, so if I emerge ifplugd, should the /etc/init.d/net.* scripts work in the way I mentioned above?  It will not get to the point where DHCP is called if there is no ethernet cable?  Is that what you're saying?

   I could only find ifplugd in portage, where is netplugd found?
Comment 4 Roy Marples (RETIRED) gentoo-dev 2006-11-20 07:04:03 UTC
(In reply to comment #3)
>    Wait, so if I emerge ifplugd, should the /etc/init.d/net.* scripts work in
> the way I mentioned above?  It will not get to the point where DHCP is called
> if there is no ethernet cable?

Correct. It will background.
When a cable is plugged in it will automatically run DHCP.
When the cable is removed the interface will be stopped.

>    I could only find ifplugd in portage, where is netplugd found?

sys-apps/netplug

Comment 5 Philippe Chaintreuil 2006-11-20 09:06:16 UTC
ifplugd works for me!  Thanks!