go-ps icon indicating copy to clipboard operation
go-ps copied to clipboard

Executable names might be truncated (darwin, linux)

Open gabriel opened this issue 9 years ago • 8 comments

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

gabriel avatar Jun 24 '16 02:06 gabriel

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

mitchellh avatar Jun 25 '16 23:06 mitchellh

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.

gabriel avatar Jun 28 '16 01:06 gabriel

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

Ran into a bug downstream with goss because of this.

conn avatar May 16 '19 18:05 conn

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

vipau avatar Jun 05 '19 10:06 vipau

I can confirm it does truncate the names in linux.

meskio avatar Jul 08 '19 14:07 meskio

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

evnix avatar Jul 14 '19 14:07 evnix

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

evnix avatar Jul 14 '19 14:07 evnix

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 ?

ankurnigam avatar Jun 16 '22 18:06 ankurnigam