mitchellh / go-ps

Find, list, and inspect processes from Go (golang).
MIT License
1.46k stars 250 forks source link

Executable names might be truncated (darwin, linux) #15

Open gabriel opened 8 years ago

gabriel commented 8 years ago

Process names might be truncated on darwin, linux.

This fork here which has the full process executable path, uses filepath.Base(..) to get the full name: https://github.com/keybase/go-ps

mitchellh commented 8 years ago

Looks great! Can you point me to where I should merge any changes?

gabriel commented 8 years ago

You could create a pull request (or compare changes) and then pick and choose what changes you want? https://github.com/mitchellh/go-ps/compare/master...keybase:master

If you need, I could also prepare a pull-request which has these fixes (and adds more tests etc), but might be a week or so before I can get to it.

conn commented 5 years ago

Still confirming this as a problem. Do you need a hand?

Ran into a bug downstream with goss because of this.

vipau commented 5 years ago

Thanks for pointing me to the fork, @gabriel . BTW @mitchellh you have a pull request open for fixing this on OSX. Regarding Linux, I think the issue is reading /proc/$pid/stat instead of /proc/$pid/cmdline

meskio commented 4 years ago

I can confirm it does truncate the names in linux.

evnix commented 4 years ago

Fix for now is to just import github.com/keybase/go-ps @mitchellh seems to have abandoned this repo ☹️

evnix commented 4 years ago

or use https://github.com/shirou/gopsutil

ankurnigam commented 2 years ago

do we have fix available for linux ? Are we going to merge it as I still see the same problem in github.com/mitchellh/go-ps ?