gopsutil icon indicating copy to clipboard operation
gopsutil copied to clipboard

Kubernetes Process Name Error

Open zzhzero opened this issue 4 years ago • 1 comments

Describe the bug

process.name != readfile(/proc/{pid}/comm)

To Reproduce The original code cannot be provided

I tried the following logic,It's not real code :

p = newProcess(pid)
print(p.Name()) //out: a-b-docker
conn= ReadFile(/proc/{pid}/comm)
printf(string(conn)) //out: a-b-do

The two outputs are inconsistent

I try to execute ps -e |grep {pid} // out: a-b-do The result is the same as comm

Environment:

Centos 7

The process is managed by kubernetes

I try to execute the test code on the machine where the process is located

zzhzero avatar Sep 29 '21 02:09 zzhzero

https://github.com/shirou/gopsutil/blob/cc70488af8e4039f4aa96a3904df845fc5723aa8/process/process_linux.go#L856

The problem seems to be here

zzhzero avatar Sep 29 '21 02:09 zzhzero