Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Boot hangs on DHCP when ethernet cable not connected[SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cazort
Guru
Guru


Joined: 19 Sep 2004
Posts: 343
Location: Lancaster, PA

PostPosted: Tue Jun 10, 2008 11:01 pm    Post subject: Boot hangs on DHCP when ethernet cable not connected[SOLVED] Reply with quote

I have a laptop, which, like many people, I like to connect to ethernet when it's available, and fall back on wireless support when it's not. I have the ethernet set to DHCP because I use it at different locations.

When I boot and am not connected to an ethernet connection, it sees the ethernet and hangs for quite some time, waiting for DHCP.

The computer seems to have the capability to detect instantly whether or not a cable is plugged in for which a device is attached to it. How can I have it utilize this information on boot so that it only tries to do DHCP if a cable is actually plugged in and attached to another device? It seems a senseless waste of time, and it puzzles me that the default behaviour is for it to wait to do DHCP even when nothing is attached.

I'd like to not only solve this for myself personally, but contribute some of my time and energy to Gentoo to get the default behaviour improved. Any ideas?
_________________
Alex Zorach | Teacology | RateTea | Why This Way


Last edited by cazort on Thu Jun 12, 2008 4:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Tue Jun 10, 2008 11:30 pm    Post subject: Reply with quote

From /etc/conf.d/net.example:

Quote:
# For passing custom options to dhcpcd use something like the following. This
# example reduces the timeout for retrieving an address from 60 seconds (the
# default) to 10 seconds.
#dhcpcd_eth0="-t 10"


If you can find how to get it to detect a connected cable, that would be better though.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Wed Jun 11, 2008 2:42 am    Post subject: Re: Boot hangs on DHCP when ethernet cable not connected Reply with quote

cazort wrote:
The computer seems to have the capability to detect instantly whether or not a cable is plugged in for which a device is attached to it. How can I have it utilize this information on boot so that it only tries to do DHCP if a cable is actually plugged in and attached to another device?

The Gentoo networking scripts already support this.
Code:
# emerge ifplugd
# /etc/init.d/net.eth0 restart
Back to top
View user's profile Send private message
cazort
Guru
Guru


Joined: 19 Sep 2004
Posts: 343
Location: Lancaster, PA

PostPosted: Wed Jun 11, 2008 2:58 am    Post subject: Reply with quote

If I understand it correctly, ifplugd is a daemon. I don't want any daemon running, I just want it to make the correct decision at startup when it sets up the interface. If I emerge ifplugd, will this fix the problem of loading at boot, without actually loading the daemon?
_________________
Alex Zorach | Teacology | RateTea | Why This Way
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Wed Jun 11, 2008 3:24 am    Post subject: Reply with quote

Doesn't look like it. But it is a very small daemon, about 25KB or so.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Wed Jun 11, 2008 3:01 pm    Post subject: Reply with quote

cazort wrote:
If I understand it correctly, ifplugd is a daemon. I don't want any daemon running ...

Your DHCP client is a daemon too ...

I personally use ifplugd because I love the convenience of being able to plug and unplug the cable whenever I want, and the networking scripts just do the right thing.
Back to top
View user's profile Send private message
cazort
Guru
Guru


Joined: 19 Sep 2004
Posts: 343
Location: Lancaster, PA

PostPosted: Thu Jun 12, 2008 4:18 pm    Post subject: Reply with quote

Thanks! This worked!
_________________
Alex Zorach | Teacology | RateTea | Why This Way
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum