Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 17162 - Needed daemons fail to start due to lack of a dhcp server.
Summary: Needed daemons fail to start due to lack of a dhcp server.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-09 13:46 UTC by Frederick Reeve
Modified: 2004-05-07 15:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix this "bug". Modifies net.eth0. (net.eth0.diff,1.30 KB, patch)
2003-03-09 13:50 UTC, Frederick Reeve
Details | Diff
The other patch for /etc/conf.d/net (net.diff,728 bytes, patch)
2003-03-09 13:52 UTC, Frederick Reeve
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederick Reeve 2003-03-09 13:46:10 UTC
I have made some small changes to the default /etc/inid.d/net.eth0 and
/etc/conf.d/net.  These changes simply add functionality alowing for an
alternate ip config should dhcpcd fail to find a server.  I made these
changes because I use a labtop and when I would boot away from my
network apache, fam, metalog, and other needed daemons would fail causing poblems
for many programs (at least ones I run) and this prevents this.  Anyway
I will attach the diffs after filing this report.

Reproducible: Always
Steps to Reproduce:
1. setup dhcp in /etc/conf.d/net
2. unplug network cable from computer
3. restart

Actual Results:  
As stated due to script depends the failure of net.ethx causes needed daemons
not to start.


Expected Results:  
If dhcpcd failes an alternate ip address for the interface should be set.


I know any one can write a work around for this I just thought it would be nice
it did it by default.  Also I used dhcpcd -t 30 by default because after some
testing I found the default 60 sec to be way more than needed and yet 20 was not
enough on some networks.  I think 30 is a good medium. However this is no big deal.
Comment 1 Frederick Reeve 2003-03-09 13:50:43 UTC
Created attachment 9173 [details, diff]
Patch to fix this "bug".  Modifies net.eth0.
Comment 2 Frederick Reeve 2003-03-09 13:52:52 UTC
Created attachment 9174 [details, diff]
The other patch for /etc/conf.d/net
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-03-12 18:02:23 UTC
Sorry, just a bit hecktic this side.  Looks good as I said in lists, but
it will be a bit more effort to merge against cvs which have changed some.
Comment 4 Wout Mertens (RETIRED) gentoo-dev 2003-03-14 06:36:22 UTC
Can you elaborate on the need of the ip address? If I understand you correctly, you have a number of  
daemons that fail to load because they are bound on an interface and stop when that interface isn't  
up?  
Why is metalog in that list, and fam?  
What if you tell apache to just listen to all traffic, regardless of interface?  
What happens if you go somewhere else, and you get a different IP address?  
  
I use a laptop with and without network, with fam and metalog, and have no problems in that  
department. I use wwwoffled for caching/proxying http traffic, and switch it to offline mode when  
not connected. I switch around configurations for wwwoffled according to where I am, so that I just  
have to switch proxies in one location.  
  
I'm not saying that your needs aren't valid, just wondering if there are other ways.  
  
Assuming that you have a valid needs, and looking at the code, it looks like you made it more  
confusing than it need be. This only needs to be an extra if-clause in the case where dhcp is used. 
And I think it would be best if the configuration variable would be called dhcpcd_fail_ip_<iface>, 
so that it has the same naming convention as the rest, with the interface at the end. 
 
Also, I think that your solution could be improved: 
1) You want to check if your cable is connected. You can do that much faster with mii-tool, in all 
probability. In fact, I wrote a script that monitors mii-tool, and brings up my interface as soon as I 
plug in the cable. I'll make it available when it's ready.  
2) What IP address do you want to give it? Perhaps, if dhcp fails, we could provide a list of configs 
and hosts that should be on-line for that network to make sense. Then, if cable is plugged in (or if it 
cannot be detected), and dhcpcd fails, it will go over the list one by one until it gets a config that 
works. Or the other way round, dhcpcd takes more time. 
 
Azarah, what do you think? 
 
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2003-03-16 11:25:46 UTC
I am not user of dhcp.  If you guys can sort it out to be a generic and working
fix, I will apply.
Comment 6 Georg Müller 2003-04-03 16:07:54 UTC
I posted the solution for me in
http://bugs.gentoo.org/show_bug.cgi?id=16665

With the cable - think about wlan ;-) There is no cable...

But there are tools like netenv, http://netenv.sourceforge.net/
which might be interesting for this problem...
Comment 7 Aron Griffis (RETIRED) gentoo-dev 2004-05-07 15:41:09 UTC
This is fixed in baselayout-1.9.0 using ifconfig_fallback_eth0.  See bug 48305