FS#23282 - [initscripts] terminate 'dhcpcd' using the correct '-k' option
Attached to Project:
Arch Linux
Opened by Xavion (Xavion) - Tuesday, 15 March 2011, 09:12 GMT
Last edited by Andrea Scarpino (BaSh) - Wednesday, 16 March 2011, 15:12 GMT
Opened by Xavion (Xavion) - Tuesday, 15 March 2011, 09:12 GMT
Last edited by Andrea Scarpino (BaSh) - Wednesday, 16 March 2011, 15:12 GMT
|
Details
This bug report is intended for the maintainer of the
'initscripts' package and relates to his "/etc/rc.d/network"
script. I just posted the following to the 'NetworkManager'
bug databases, as it suffers from the same problem.
----- If my modem/router is switched off (e.g. overnight), I can't reconnect - via Ethernet or wireless - the next time it's switched on, without having to mess around first. This is because your script doesn't terminate 'dhcpcd' via the '-k' option. The effect is that the stale ".lease" file from the previous session (day) remains in "/var/lib/dhcpcd/". This ".lease" file is automatically reused when reconnecting, but my modem/router forgot about it while switched off (e.g. overnight). This means that initial connection attempts are rejected until I delete it. I'm guessing that all users with NetComm modem/routers - and probably others - would be facing this problem every time they switch theirs on. Will you please terminate 'dhcpcd' using the '-k' option in future releases? For example, instead of using "/usr/bin/killall dhcpcd", you would use "/sbin/dhcpcd -k [interface]". I have already tested this here and I can confirm that the stale ".lease" file is deleted as expected. |
This task depends upon
1) The router sends DHCPACK, allowing you to use the old lease.
2) The router sends DHCPNAK, and dhcpcd will request a new lease using DHCPDISCOVER.
3) The router doesn't reply, and after a timeout dhcpcd will request a new lease using DHCPDISCOVER.
Thanks for submitting the patch. It's pretty much the same as what I added here yesterday. I'll now see if I can get the "/etc/rc.d/net-auto-wire{d,less}" scripts to terminate 'dhcpcd' cleanly too.
@Thomas
My router isn't 'broken', since its twin brother behaves identically interstate. Maybe its DHCP server code is buggy, but I wish to be clear that both routers work perfectly otherwise.
A NetworkManager developer provided me with a similar response, which you might be interested in reading here: https://bugzilla.gnome.org/show_bug.cgi?id=644798
I'll see if I can determine exactly how my NetComm NB6W handles the lease-rejection process. I'll post the details here once I've figured out what's happening.
completely new lease if the renew fails?" dhcpcd actually requests a new lease when renewing fails or times out, so I don't know what happens here.
Anyway, http://projects.archlinux.org/initscripts.git/commit/?id=4f9282efa03872c3e298156a21d524734e8f5ab1
Okay, I've worked out what's going on at my end. You're right that my modem/router is behaving oddly. You can see from the attached output what happened when I then tried to reconnect. Instead of rejecting the (now) unrecognised lease, my modem/router acknowledged it and set the IP address to "0.0.0.0".
I just posted a more detailed description of this new information to the 'dhcpcd' mailing list. You can view my email here: http://roy.marples.name/archives/dhcpcd-discuss/2011/0310.html. I will also contact the technical support area of NetComm to see if they can provide any insight about the issue.