View previous topic :: View next topic |
Author |
Message |
VinzC Watchman


Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Fri Oct 19, 2007 7:55 am Post subject: dhcpcd 3.1.5 loops forever when no cable plugged in |
|
|
Hi.
I've recently upgraded dhcpcd to version 3.1.5 and I now see it doesn't exit after timing out. The man pages say when -t is given dhcpcd exits if it times out while waiting for an IP address (it also says dhcpcd loops forever if the timeout value is zero). But it doesn't exit in my case although I set the time out value to 10 seconds. I have to kill dhcpcd. This problem happens when no cable is plugged in.
Should I file a bug or has anybody already done that? _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
 |
mamac l33t


Joined: 29 Feb 2004 Posts: 890
|
Posted: Fri Oct 19, 2007 8:21 am Post subject: |
|
|
Hi,
I know I will not answer your question but did you try to manage the interface with ifplugd?
I'm not with my Gentoo right now, I'll check which version I use. _________________ Powered by Gentoo Linux since 2003 |
|
Back to top |
|
 |
VinzC Watchman


Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Fri Oct 19, 2007 8:24 am Post subject: |
|
|
mamac wrote: | Hi,
Did you try to manage the interface with ifplugd? |
No, I didn't - I have a custom network script. But I don't mind to kill dhcpcd manually; what puzzles me is that it doesn't seem to behave as mentioned in the man pages. You can type the command and it'll behave exactly as I described. So there must be a bug somewhere. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
 |
mamac l33t


Joined: 29 Feb 2004 Posts: 890
|
Posted: Fri Oct 19, 2007 8:38 am Post subject: |
|
|
I use 3.1.5 without problem.
Code: |
FRPC285 ~ # emerge -s dhcpcd
Searching...
[ Results for search key : dhcpcd ]
[ Applications found : 1 ]
* net-misc/dhcpcd
Latest version available: 3.1.5
Latest version installed: 3.1.5
Size of files: 39 kB
Homepage: http://dhcpcd.berlios.de
Description: A DHCP client
License: GPL-2
|
My /etc/conf.d/net:
Code: |
FRPC285 ~ # cat /etc/conf.d/net
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d. To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
dns_domain_lo="btworld.net"
dhcpcd_eth0="-N"
config_eth0=( "dhcp" )
modules=( "wpa_supplicant" )
wpa_supplicant_eth1="-Dwext"
dhcpcd_eth1="-N"
config_eth1=( "dhcp" )
|
I don't even use the -t option _________________ Powered by Gentoo Linux since 2003 |
|
Back to top |
|
 |
VinzC Watchman


Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Fri Oct 19, 2007 10:28 am Post subject: |
|
|
There is no problem about networking in fact, just that dhcpcd does *not* exit when timing out and the network cable is not plugged in. There is no indication in that it doesn't exit but in the log:
Code: | ...
Oct 16 22:50:03 solo dhcpcd[5440]: eth0: broadcasting for a lease
Oct 16 22:50:13 solo dhcpcd[5440]: eth0: timed out
Oct 16 22:50:13 solo dhcpcd[5440]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 16 22:50:13 solo dhcpcd[5440]: eth0: checking 169.254.109.154 is available on attached networks
Oct 16 22:50:14 solo dhcpcd[5440]: eth0: adding IP address 169.254.109.154/16
Oct 16 22:50:19 solo dhcpcd[5440]: eth0: broadcasting for a lease
Oct 16 22:50:29 solo dhcpcd[5440]: eth0: timed out
Oct 16 22:50:29 solo dhcpcd[5440]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 16 22:50:29 solo dhcpcd[5440]: eth0: checking 169.254.109.154 is available on attached networks
Oct 16 22:50:30 solo dhcpcd[5440]: eth0: adding IP address 169.254.109.154/16
Oct 16 22:50:35 solo dhcpcd[5440]: eth0: broadcasting for a lease
Oct 16 22:50:45 solo dhcpcd[5440]: eth0: timed out
Oct 16 22:50:45 solo dhcpcd[5440]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 16 22:50:45 solo dhcpcd[5440]: eth0: checking 169.254.109.154 is available on attached networks
Oct 16 22:50:46 solo dhcpcd[5440]: eth0: adding IP address 169.254.109.154/16
Oct 16 22:50:51 solo dhcpcd[5440]: eth0: broadcasting for a lease
Oct 16 22:51:01 solo dhcpcd[5440]: eth0: timed out
Oct 16 22:51:01 solo dhcpcd[5440]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 16 22:51:01 solo dhcpcd[5440]: eth0: checking 169.254.109.154 is available on attached networks
Oct 16 22:51:02 solo dhcpcd[5440]: eth0: adding IP address 169.254.109.154/16
Oct 16 22:51:07 solo dhcpcd[5440]: eth0: broadcasting for a lease
Oct 16 22:51:17 solo dhcpcd[5440]: eth0: timed out
Oct 16 22:51:17 solo dhcpcd[5440]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 16 22:51:17 solo dhcpcd[5440]: eth0: checking 169.254.109.154 is available on attached networks
Oct 16 22:51:18 solo dhcpcd[5440]: eth0: adding IP address 169.254.109.154/16
...
Oct 19 09:45:17 solo dhcpcd[5439]: eth0: received SIGTERM, stopping
Oct 19 09:45:17 solo dhcpcd[5439]: eth0: deleting IP address 169.254.84.182/16
Oct 19 09:45:17 solo dhcpcd[5439]: eth0: exiting |
Instead of broadcasting for a lease ever 10 seconds dhcpcd should give up and exit, which it obviously doesn't. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
 |
Bio Apprentice

Joined: 17 Mar 2003 Posts: 197 Location: Geneva which should be in Switzerland...
|
Posted: Fri Oct 19, 2007 10:44 am Post subject: |
|
|
I have a similar problem, which happened yesterday when I rebooted my router. I have netplug which notice when the network is going down and up and start/stop my eth0 interface accordingly. But when eth0 is up again DHCP starts, obtain a lease from the DHCP server then loop endlessly :
Code: |
Oct 19 00:26:07 Maverick netplugd[532]: /etc/netplug.d/netplug eth0 out -> pid 532
Oct 19 00:26:09 Maverick dhcpcd[4057]: eth0: received SIGTERM, stopping
Oct 19 00:26:09 Maverick dhcpcd[4057]: eth0: removing default route via 192.168.0.1 metric 0
Oct 19 00:26:09 Maverick dhcpcd[4057]: eth0: deleting IP address 192.168.0.6/24
Oct 19 00:26:09 Maverick dhcpcd[4057]: eth0: exiting
Oct 19 00:26:09 Maverick netplugd[3413]: eth0: state OUTING pid 532 exited status 0
Oct 19 00:26:12 Maverick eth0: Autonegotiation advertising 0x5e1 partner 0x41e1.
Oct 19 00:26:12 Maverick eth0: link up.
Oct 19 00:26:12 Maverick netplugd[3413]: eth0: state INACTIVE flags 0x00001003 UP,BROADCAST,MULTICAST -> 0x00011043 UP,BROADCAST,RUNNING,MULTICAST,10000
Oct 19 00:26:12 Maverick netplugd[1093]: /etc/netplug.d/netplug eth0 in -> pid 1093
Oct 19 00:26:13 Maverick dhcpcd[1506]: eth0: dhcpcd 3.1.5 starting
Oct 19 00:26:13 Maverick dhcpcd[1506]: eth0: broadcasting for a lease
Oct 19 00:26:23 Maverick dhcpcd[1506]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 19 00:26:23 Maverick dhcpcd[1506]: eth0: probing for an IPV4LL address
Oct 19 00:26:23 Maverick dhcpcd[1506]: eth0: checking 169.254.183.124 is available on attached networks
Oct 19 00:26:24 Maverick dhcpcd[1506]: eth0: adding IP address 169.254.183.124/16
Oct 19 00:26:24 Maverick netplugd[3413]: eth0: state INNING pid 1093 exited status 0
Oct 19 00:26:29 Maverick dhcpcd[1507]: eth0: broadcasting for a lease
Oct 19 00:26:39 Maverick dhcpcd[1507]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 19 00:26:39 Maverick dhcpcd[1507]: eth0: checking 169.254.183.124 is available on attached networks
Oct 19 00:26:40 Maverick dhcpcd[1507]: eth0: adding IP address 169.254.183.124/16
Oct 19 00:26:45 Maverick dhcpcd[1507]: eth0: broadcasting for a lease
Oct 19 00:26:55 Maverick dhcpcd[1507]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 19 00:26:55 Maverick dhcpcd[1507]: eth0: checking 169.254.183.124 is available on attached networks
Oct 19 00:26:56 Maverick dhcpcd[1507]: eth0: adding IP address 169.254.183.124/16
Oct 19 00:27:01 Maverick dhcpcd[1507]: eth0: broadcasting for a lease
Oct 19 00:27:11 Maverick dhcpcd[1507]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 19 00:27:11 Maverick dhcpcd[1507]: eth0: checking 169.254.183.124 is available on attached networks
Oct 19 00:27:12 Maverick dhcpcd[1507]: eth0: adding IP address 169.254.183.124/16
Oct 19 00:27:17 Maverick dhcpcd[1507]: eth0: broadcasting for a lease
Oct 19 00:27:27 Maverick dhcpcd[1507]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 19 00:27:27 Maverick dhcpcd[1507]: eth0: checking 169.254.183.124 is available on attached networks
Oct 19 00:27:28 Maverick dhcpcd[1507]: eth0: adding IP address 169.254.183.124/16
Oct 19 00:27:33 Maverick dhcpcd[1507]: eth0: broadcasting for a lease
Oct 19 00:27:34 Maverick dhcpcd[1507]: eth0: offered 192.168.0.6 from 192.168.0.1
Oct 19 00:27:34 Maverick dhcpcd[1507]: eth0: received NAK: (null)
Oct 19 00:27:34 Maverick dhcpcd[1507]: eth0: broadcasting for a lease
Oct 19 00:27:34 Maverick dhcpcd[1507]: eth0: offered 192.168.0.6 from 192.168.0.1
Oct 19 00:27:34 Maverick dhcpcd[1507]: eth0: received NAK: (null)
Oct 19 00:27:34 Maverick dhcpcd[1507]: eth0: broadcasting for a lease
Oct 19 00:27:34 Maverick dhcpcd[1507]: eth0: offered 192.168.0.6 from 192.168.0.1
Oct 19 00:27:34 Maverick dhcpcd[1507]: eth0: received NAK: (null)
Oct 19 00:27:34 Maverick dhcpcd[1507]: eth0: broadcasting for a lease
Oct 19 00:27:34 Maverick dhcpcd[1507]: eth0: offered 192.168.0.6 from 192.168.0.1
Oct 19 00:27:35 Maverick dhcpcd[1507]: eth0: received NAK: (null)
Oct 19 00:27:35 Maverick dhcpcd[1507]: eth0: broadcasting for a lease
Oct 19 00:27:35 Maverick dhcpcd[1507]: eth0: offered 192.168.0.6 from 192.168.0.1
Oct 19 00:27:35 Maverick dhcpcd[1507]: eth0: received NAK: (null)
|
Those 3 lines
Oct 19 00:27:35 Maverick dhcpcd[1507]: eth0: broadcasting for a lease
Oct 19 00:27:35 Maverick dhcpcd[1507]: eth0: offered 192.168.0.6 from 192.168.0.1
Oct 19 00:27:35 Maverick dhcpcd[1507]: eth0: received NAK: (null)
repeat endlessly till I manually restart eth0. Obviously the network on my gentoo box is down while this DHCP stuff happens _________________ I'm all in ! |
|
Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
 |
VinzC Watchman


Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Fri Oct 19, 2007 2:42 pm Post subject: |
|
|
Thanks a lot for that quick response, UberLord. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
 |
BrummieJim l33t

Joined: 22 Jul 2005 Posts: 683
|
Posted: Fri Oct 19, 2007 4:19 pm Post subject: |
|
|
yeah, there seem to be a lot of problems with the 3.x versions of dhcpd, just downgrade to a 2.x version using package.mask. |
|
Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
 |
VinzC Watchman


Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Sat Oct 20, 2007 2:49 pm Post subject: |
|
|
Version 3.1.6-r1 fixes the problem. Thanks again. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
 |
VinzC Watchman


Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Sun Oct 21, 2007 9:45 am Post subject: |
|
|
As an indication, I've had to use the vram flag because the company I'm working for has a DHCP server on Windows 2000, which doesn't fully implement RFC 4361 (the ClientID field probably requires only the MAC address).
My PC got an IP address that was not the one I had reserved on the DHCP. Note while I'm writing this I realized there is a client ID field in the DHCP reservation, which I filled with a value that seemed logical at that time because I didn't know what to enter exactly. The value of that field might just not match the one sent by dhcpcd on my PC. I'll check that next time. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
 |
VinzC Watchman


Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Sun Oct 21, 2007 5:02 pm Post subject: |
|
|
I spoke too early . Then I investigated a little more and I happened to read that dhcpcd now can give an Automatic IP Address if it times out. In that case it doesn't exit unless the -L argument is specified. I then changed my script and added the -L argument when calling dhcpcd and the problem disappeared.
Now I'm not sure whether it's a bug or not but I found my system log filled with dhcpcd renewal attempts every 10 seconds - it's the time-out value I used. That's a little odd . _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
 |
VinzC Watchman


Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Tue Oct 23, 2007 7:18 am Post subject: |
|
|
I've tested version 3.1.7 but it's the same result: if dhcpcd starts while there is no cable plugged in for eth0 it loops forever a) trying to broadcast for an IP address and b) setting the same APIPA afterwards - as per the log excerpt I posted. Adding -L to the command line arguments is still the only work around I've found.
EDIT: Note there are two distinct processes, one of which is spawned *after* the time out is first logged and which loops forever. It's illustrated here, see the dhcpcd PID:
Code: | Oct 23 09:02:11 solo dhcpcd[8025]: eth0: dhcpcd 3.1.7 starting
Oct 23 09:02:11 solo dhcpcd[8025]: eth0: hardware address = 00:18:8b:c7:aa:ed
Oct 23 09:02:11 solo dhcpcd[8025]: eth0: broadcasting for a lease
Oct 23 09:02:21 solo dhcpcd[8025]: eth0: timed out
Oct 23 09:02:21 solo dhcpcd[8025]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 23 09:02:22 solo dhcpcd[8025]: eth0: checking 169.254.84.182 is available on attached networks
Oct 23 09:02:23 solo dhcpcd[8025]: eth0: adding IP address 169.254.84.182/16
Oct 23 09:02:23 solo dhcpcd[8025]: eth0: exiting
Oct 23 09:02:28 solo dhcpcd[8026]: eth0: broadcasting for a lease
... [eth1 is now getting its IP]
Oct 23 09:02:38 solo dhcpcd[8026]: eth0: timed out
Oct 23 09:02:38 solo dhcpcd[8026]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
Oct 23 09:02:38 solo dhcpcd[8026]: eth0: checking 169.254.84.182 is available on attached networks
Oct 23 09:02:39 solo dhcpcd[8026]: eth0: adding IP address 169.254.84.182/16
Oct 23 09:02:44 solo dhcpcd[8026]: eth0: broadcasting for a lease
Oct 23 09:02:54 solo dhcpcd[8026]: eth0: timed out
... |
Process 8025 times out and exits. But another dhcpcd process, 8026 is spawned immediately after, that loops until I kill dhcpcd. It also looks like dhcpcd spawns a second process *before* if actually exits - I'm running two dhcpcd commands one after the other, one for eth0 the second for eth1, wireless. It is indicated in the log [eth1 is now getting its IP], which means dhcpcd main process, 8025, doesn't quit and return before spawning another process, 8026.
FYI I'm running Gentoo on a Core 2 (Centrino) Duo, amd64 branch. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
 |
toralf Developer


Joined: 01 Feb 2004 Posts: 3943 Location: Hamburg
|
Posted: Tue Oct 23, 2007 8:06 am Post subject: |
|
|
Have a look at the option "-L". |
|
Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Tue Oct 23, 2007 9:12 am Post subject: |
|
|
What you are seeing is correct behaviour - it's got a link local address (ipv4ll, apipa, zeroconf, etc) and it's then checks for a dhcp server every 5 seconds.
Basically what happens is when it gets the first address (dhcp or link local) it forks to the background. This is what you are seeing, and is correct behaviour.
Quote: | dhcpcd[1507]: eth0: received NAK: (null) |
That on the other hand you should not be seeing and should be fixed in dhcpcd-3.1.7 _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
 |
Bio Apprentice

Joined: 17 Mar 2003 Posts: 197 Location: Geneva which should be in Switzerland...
|
Posted: Tue Oct 23, 2007 3:30 pm Post subject: |
|
|
UberLord wrote: | Quote: | dhcpcd[1507]: eth0: received NAK: (null) |
That on the other hand you should not be seeing and should be fixed in dhcpcd-3.1.7 |
I'm the one who gets the NAK stuff. I got a chance to try dhcpcd 3.1.6 this week end but the problem remained so I'm back to dhcpcd-3.1.5. I will try 3.1.7 ASAP and let you know. _________________ I'm all in ! |
|
Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
 |
VinzC Watchman


Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Tue Oct 23, 2007 6:02 pm Post subject: |
|
|
UberLord wrote: | What you are seeing is correct behaviour - it's got a link local address (ipv4ll, apipa, zeroconf, etc) and it's then checks for a dhcp server every 5 seconds.
Basically what happens is when it gets the first address (dhcp or link local) it forks to the background. This is what you are seeing, and is correct behaviour. |
That's frightening! after 24 hours the system log would be filled up with 43,200 lines of garbage after all... You'd argue that I could check for the cable before I run dhcpcd or use netplug or something alike. But don't you agree it's a little too much verbose in this case?
[If dhcpcd were a tow-coloured, she'd only deserve to be slapped... ]
May I suggest to
- decrease the amount of text that is output or
- decrease the number of times the same lines are output or
- stop jabbering after xyz minutes/seconds/hours/whatever or
- be verbose only when things *change*.
There have been other examples in the past where gossip services were forced to shut up after a certain amount of time - don't remember which ones exactly.
[And, no, I have nothing against Paris Hilton ]
[And the Troll-Fighters go: ooooooh-ooooooh-ooooh...] _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Last edited by VinzC on Wed Oct 24, 2007 8:37 am; edited 1 time in total |
|
Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
 |
VinzC Watchman


Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Wed Oct 24, 2007 8:35 am Post subject: |
|
|
UberLord wrote: | That's a good idea - file a bug for it so I don't forget!
Thanks. |
Done.
All the best, man  _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
 |
Bio Apprentice

Joined: 17 Mar 2003 Posts: 197 Location: Geneva which should be in Switzerland...
|
Posted: Thu Oct 25, 2007 6:12 pm Post subject: |
|
|
UberLord wrote: | Bio wrote: | I'm the one who gets the NAK stuff. I got a chance to try dhcpcd 3.1.6 this week end but the problem remained so I'm back to dhcpcd-3.1.5. I will try 3.1.7 ASAP and let you know. |
Try and post a log snippet when you have the -d option used - it should log much more info then. |
OK just did a test with version 3.1.7, problem solved ! No more NAK stuff and dhcpcd obtains a lease.
If you want the log (-d flag enabled) I will post them, though they are rather long.
Thanks _________________ I'm all in ! |
|
Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
 |
|