View previous topic :: View next topic |
Author |
Message |
WTFman Apprentice
Joined: 04 Apr 2005 Posts: 153
|
Posted: Sun May 01, 2005 12:38 am Post subject: DHCP stalling at boot time [Solved] |
|
|
Ok when I startup Gentoo on my system everything seems to load fine up until the following line:
bringing up eth0 via DHCP....
then it will stall and sometimes even fail to load. I found this thread with a similar problem, however I'm not as 1337 as most people here so I'm not quite sure where to add dhcpcd -k I checked my /etc/init.d/net.eth0 file and the only instance of dhcpcd -z is in an if line.
Just to be sure that this is the problem, last couple of times I shut down my computer I manualy typed the command "dhcpcd -k" first and when I turned on my computer DHCP loaded up much faster, so how do I make sure this command is given automatically at shutdown? _________________ Occupation: Professional Slacker
Hobbies/Interests: Open Source Aficionado since 2005
Last edited by WTFman on Sat May 21, 2005 4:54 am; edited 1 time in total |
|
Back to top |
|
|
Spyretto n00b
Joined: 28 Feb 2004 Posts: 50 Location: Tampere/Finland
|
Posted: Sun May 01, 2005 2:31 am Post subject: |
|
|
I have a feeling that you machine doesn't stalls.Instead it is looking for a dhcp answer from a dhcp server.
If you leave your computer and return after 5 minutes is everything ok ?
Try this:
and add this line to /etc/conf.d/local.start
|
|
Back to top |
|
|
WTFman Apprentice
Joined: 04 Apr 2005 Posts: 153
|
Posted: Sun May 01, 2005 4:02 am Post subject: |
|
|
Spyretto wrote: | I have a feeling that you machine doesn't stalls.Instead it is looking for a dhcp answer from a dhcp server. |
Sorry if I used the wrong term, yes it appears that is what it's doing, I would just like it if it did this a little more quickly.
Spyretto wrote: | If you leave your computer and return after 5 minutes is everything ok ? |
More often than not, yes, however the first time I boot my system it often comes up with a message like "netmount failed to start" aside from that everything that doesn't require an internet connection works fine. If I reboot my computer afterwards, everything starts as normal, internet connection included.
Spyretto wrote: | Try this:
and add this line to /etc/conf.d/local.start
| Will have to test this out more, booted up a couple of times like this, results are very much the same only KDE will load before I have a working internet connection, sometimes leaving me with a browser or messenger that doesn't work. Should I also have this in my /etc/conf.d/stop file? _________________ Occupation: Professional Slacker
Hobbies/Interests: Open Source Aficionado since 2005 |
|
Back to top |
|
|
WTFman Apprentice
Joined: 04 Apr 2005 Posts: 153
|
Posted: Thu May 19, 2005 4:35 am Post subject: |
|
|
Allright, while this does work, having dhcp started after KDE gets annoying when my desktop is ready, but my connection isn't up yet. I'd rather wait the extra few seconds so I know when KDE comes up that my internet connection is ready to go, so I'll ask if anyone knows another way to make sure dhcpcd is given the kill command automaticaly at shutdown??? anybody? _________________ Occupation: Professional Slacker
Hobbies/Interests: Open Source Aficionado since 2005 |
|
Back to top |
|
|
jakubc Tux's lil' helper
Joined: 21 Jan 2005 Posts: 138 Location: Prague <- Czech Republic <- Europe <- World...
|
Posted: Thu May 19, 2005 2:06 pm Post subject: |
|
|
well there is the "-t" option which tells dhcpcd how long to fish around for the ip...
Code: |
-t <timeout>
Specifies (in seconds ) for how long dhcpcd will try to get an
IP address. The default is 60 seconds. dhcpcd will not fork
into background until it gets a valid IP address in which case
dhcpcd will return 0 to the parent process. In a case dhcpcd
times out before receiving a valid IP address from DHCP server
dhcpcd will return exit code 1 to the parent process.
|
although how the default 60 seconds plays into your 5 minute waiting period I have no idea... _________________ Regards,
Jakub Cerny |
|
Back to top |
|
|
b060 n00b
Joined: 24 Apr 2004 Posts: 70 Location: Mexico formerly known as Tenochtitlan
|
Posted: Thu May 19, 2005 8:47 pm Post subject: |
|
|
I was in the same problem and I did
And now I dont have eth0 nor aclue to get it back _________________ It's OK to be ignorant; it's not OK to play stupid but its your choice anyway |
|
Back to top |
|
|
WTFman Apprentice
Joined: 04 Apr 2005 Posts: 153
|
Posted: Fri May 20, 2005 1:35 am Post subject: |
|
|
Ok here we go I figured it out w/trial by fire!
I put net.eth0 back in the runlevel default.
now somewhere in your etc/init.d/net.eth0 file you should see something like this (scroll down):
Code: |
# Stop DHCP (should be N/A for aliases)
# Don't trust current configuration... investigate ourselves
if /sbin/dhcpcd -z ${i} &>${devnull}; then
ebegin " Releasing DHCP lease for ${IFACE}"
for ((count = 0; count < 9; count = count +1)); do
/sbin dhcpcd -z ${i} &>{devnull} || break
sleep 1
|
Now I wish the other thread had explained this better because I am not a programer (I'm a total n00b) but I'm not afraid to get my hands dirty, so I'll post it clear for all the other n00bs here to read. It is the second instance of dhcpcd -z that should be changed to dhcpcd -k, so the above lines should read:
Code: |
if /sbin/dhcpcd -z ${i} &>${devnull}; then
ebegin " Releasing DHCP lease for ${IFACE}"
for ((count = 0; count < 9; count = count +1)); do
/sbin dhcpcd -k ${i} &>{devnull} || break
sleep 1
|
now, when you shut off your computer, dhcpcd should stop and when you turn it back on it should come up much faster than before.
Thank you all and good night. _________________ Occupation: Professional Slacker
Hobbies/Interests: Open Source Aficionado since 2005 |
|
Back to top |
|
|
jakubc Tux's lil' helper
Joined: 21 Jan 2005 Posts: 138 Location: Prague <- Czech Republic <- Europe <- World...
|
Posted: Fri May 20, 2005 10:20 am Post subject: |
|
|
hi,
b060: to get your eth0 back into the default runlevel type:
Code: |
rc-update add net.eth0 default
|
that should do the trick:-)
WTFman: Glad you got it working as you wanted! Looking at the manual:
Code: |
-k Sends SIGHUP signal to the dhcpcd process that is currently
running. If dhcpcd receives SIGHUP it will send DHCP_RELEASE
message to the server and destroy dhcpcd cache. In a case
dhcpcd receives SIGTERM which is normally used by shutdown(8)
when rebooting the system dhcpcd will not send DHCP_RELEASE
and will not destroy cache. When system boots dhcpcd will use
cache to request the same IP address from DHCP server which
was assigned before the system went down.
-z Sends SIGUSR1 signal to the dhcpcd process that is currently
running. If dhcpcd receives SIGUSR1 it will send DHCP_RELEASE
message to the server without destroying the dhcpcd cache.
|
it looks like your dhcpcd had problems recovering your previous IP address from it's cache, therefore producing the long wait (at least that is what I deduce from this information someone please correct me if I'm wrong). Also note, that emerging baselayout will destroy the changes you made (if your net.eth0 is linked to net.lo).
[edit] also please put a [solved] in the thread title, so people know it's solved... makes things more legible:-) _________________ Regards,
Jakub Cerny |
|
Back to top |
|
|
mattmatteh Guru
Joined: 10 Mar 2004 Posts: 449 Location: near chicago
|
Posted: Thu May 26, 2005 9:15 pm Post subject: |
|
|
what is your dhcp server or router or nat ?
maybe need a new one?
matt |
|
Back to top |
|
|
|