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

Executable names corrupted on Linux #52

Open
mcandre opened this issue Apr 10, 2021 · 1 comment
Open

Executable names corrupted on Linux #52

mcandre opened this issue Apr 10, 2021 · 1 comment

Comments

@mcandre
Copy link

mcandre commented Apr 10, 2021

Executable names are wonky. For example, /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal is truncated to unattended-upgr.

unattended-upgr is not the real executable name. It's not even a filename. It's an incomplete part of the directory name supplied as a command line argument.

@1-u-1
Copy link

1-u-1 commented Feb 29, 2024

Hello! This is an old one but this is because go-ps reads from /proc/pid/stat, which returns the same minor information as /proc/pid/comm. I opened an issue to have it read os.Readlink of the /proc/pid/exe to get the real path. In the mean time, you can write your own basic function to take the pid, build the /proc/pid/exe path and use os.Readlink to read it out. Hope this helps!

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

No branches or pull requests

2 participants