New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use non-fully-qualified path for ifconfig on linux #14
Conversation
hm, that should make it follow $PATH instead of only looking in Maybe we need to modify this " |
Indeed it will fail. $PATH should give user (and distro) a lot more flexibility than hard-coded paths. But I also think that failing when being ran with "env -i tahoe" (no $PATH set) is bad, too. So, as a compromise between these, I propose looking at a list of hard-coded paths, then falling back to $PATH for ifconfig. Lacking any objections, guess I'll update the branch to do that shortly. The most annoying thing about this error though is quite non-descriptive error message (as presented in #1536), so if paths are hard-coded, imho that's what should be fixed, at least. |
Upon more consideration, I came to a conclusion that it should be either "only $PATH" or "don't use $PATH at all", because the main benefit from it imho is expected behavior, and it's lost if $PATH isn't searched first. So I guess I'd rather extend hard-coded list of paths and provide a better error message if none of these suffice. |
It's /bin/ifconfig on exherbo and should be /usr/sbin/ifconfig on fedora after "/usr migration", and quick internet search reveals /usr/bin/ifconfig in ubuntu forums.
Please see the last commit. List of paths is generated by I've also noticed that some fallback seem to be in place (in foolscrap?) in case |
Ping. |
@kensington: did it bit you as well? Fwiw, I've seen following lines (apologies if a bit out of context) in the #tahoe-lafs@freenode (~2012-12-16):
So I'm a bit confused about whether the PR is still relevant - if something like netifaces is already a dependency, then it might make sense to implement detection using that module, but I'm quite unsure about whether that dep is agreed on (as @davidsarah quoted different opinion from @warner's). |
@mk-fg: Indeed it did, with your diff correcting the issue for me. |
The netifaces dep is not agreed on yet. We tend to be fairly conservative about adding new deps; it's very hard to get rid of them once they've been added. |
Hi, I didn't see this thread until just now. Sorry about that. I need to get a more reliable way to monitor https://tahoe-lafs trac + github. Anyway, let's open a separate ticket to consider adding a dep on netifaces. I would, at this point, be totally +1 on adding that dep (contrary to what I wrote on IRC a few weeks ago, that got pasted into this thread), except that netifaces is a C module exported through the CPython API. So I'm -1 on adding that dep. In any case, let's open a trac ticket to record our decision on that. |
I think netifaces is likely to cause as many portability problems as it solves, TBH, so I'm definitely -1 on that approach now. |
Note that /sbin is normally not on the PATH (nor should it be) for users without admin privileges. The hardcoded ['/sbin', '/bin', '/usr/sbin', '/usr/bin'] is fine by me though. |
Obsolete pull request. |
That way, actual path should be resolved through $PATH.
It's /bin/ifconfig on exherbo and should be /usr/sbin/ifconfig on fedora after "/usr migration", and quick internet search reveals /usr/bin/ifconfig in ubuntu forums.
Filed ~1y ago as #1536 in trac.