Skip to content
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

net/NetConnections relies on lsof?? #142

Open
solarisfire opened this issue Feb 3, 2016 · 3 comments
Open

net/NetConnections relies on lsof?? #142

solarisfire opened this issue Feb 3, 2016 · 3 comments

Comments

@solarisfire
Copy link

It looks like net/NetConnections relies on running the lsof executable.

The python version of psutil doesn't have this dependency.

@shirou
Copy link
Owner

shirou commented Feb 4, 2016

Yes, python psutil reles on

  • linux: proc filesystem
  • freebsd: sysctl
  • darwin: proc info
  • windoes: GetExtendedTcpTable or else

It is hard to implement all different way. But from my research, almost every UNIX like system has lsof, so I just use it. I know there are better way like psutil, but I have no time currently.
PR is always welcome!

@walles
Copy link
Contributor

walles commented Feb 9, 2016

On Darwin it relies on execing ps to find process information.

@vrecan
Copy link
Contributor

vrecan commented Feb 22, 2016

lsof isn't installed by default on a lot of platforms. This causes issues for example on centos. One test is also looking for lsof in /usr/bin/lsof

--- FAIL: Test_Parent (0.00s)
    process_test.go:293: error fork/exec /usr/bin/lsof: no such file or directory

This fails even though lsof is installed in the standard path on centos which is /usr/sbin/lsof

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants