change hardcoded dhcp client references

Bug #191091 reported by josh on 2008-02-11
2
Affects Status Importance Assigned to Milestone
wicd
Medium
Dan O'Reilly

Bug Description

The current wicd code has hardcoded references to dhclient, particularly in networking.py. While this is fine for binary distros that ship one and only one dhcp client (dhclient), there are lots of other distros out there, and some even more popular dhcp clients such as pump and (especially) dhcpcd.

Right now, distros like Zenwalk and Gentoo have to resort to sed scripts to replace dhclient references with dhcpcd etc. (http://bugs.gentoo.org/show_bug.cgi?id=198281#c14). Is it possible to rewrite wicd to be a bit more permissive of other dhcp clients? Forcing a particular dhcp client as a dependency really isn't nice -- especially for distros that believe users should be free to choose their own. Thanks.

Dan O'Reilly (oreilldf) wrote :

Yes, this will be easier in the next version. With the rewritten networking.py (which is now split into networking.py and wnettools.py) it's already simpler to change the hardcoded dhclient command, since it only has to be done in one place now. But I'd like to either have wicd check for the existence of a preset list of popular dhcp clients and then pick which one to use, or provide some way of having the user specify the command and arguments to use. Or maybe a combination of the two where wicd tries to pick one a client from a preset list, and if it can't find one then provide a way for the user to specify it manually.

Changed in wicd:
assignee: nobody → oreilldf
importance: Undecided → Medium
status: New → Confirmed
Dan O'Reilly (oreilldf) wrote :

I've added a method that checks for the existence of dhclient, pump, and dhcpcd, and then uses the first one found to connect. Somewhere down the line I might add a way to specifically choose which of those to use, or to use some other client.

josh (nightmorph) wrote :

Hey Dan! Thanks for taking care of this; much appreciated. Will it be in 1.5? :)

On a related note: I should have included a request in the original bug not just for no hardcoded dhcp clients, but hardcoded networking utilities.

I believe all distros ship with the standard net-tools package (http://sites.inka.de/lina/linux/NetTools/), yet wicd uses ethtool (at least for wired connections).

Would it be possible to either just use net-tools commands (replacing 'ip' with 'route'), or adding another method for either net-tools or ethtool? Possibly the latter would be better, on the offchance that there is a distro that doesn't use net-tools.

For example, in networking.py;
ethtool command: "ip route flush dev"
net-tools command: "route del dev"

Dan O'Reilly (oreilldf) wrote :

There has been some discussion about that recently on our forum. Namely someone brought up the ip/route issue. It's no problem to switch to using "route" instead of "ip", since as far as I know every distro has support for it. We actually originally used mii-tool to check for a wired connection, but recently switched to ethtool by default (it has a few nice things that mii-tool doesn't, although it has a few drawbacks as well). I think wicd is supposed to fall back to mii-tool if ethtool doesn't exist, but that may not be working properly in 1.4.*.

Technically ip/ethool are supposed to obsolete route/mii-tool, but I think it make sense to retain support for them. I'll make an effort to make sure wicd will work with some combination of either just net-tools commands, or both net-tools and the newer set of commands for 1.5.0.

Dan O'Reilly (oreilldf) on 2008-08-13
Changed in wicd:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers