DAOS-18563 control: Find parent process name more flexibly#17494
DAOS-18563 control: Find parent process name more flexibly#17494
Conversation
|
Ticket title is 'Check /proc/pid/comm first when getting process name' |
|
Test stage Functional on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17494/1/execution/node/1011/log |
|
Test stage Test RPMs on EL 8.6 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17494/1/execution/node/1086/log |
802262d to
6a34795
Compare
|
Test stage NLT on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17494/2/testReport/ |
6a34795 to
f4a6d8d
Compare
In some cases, it's more reliable to get the process name from /proc/$pid/comm, so prefer that with a fallback to the old method of using readlink on /proc/$pid/exe. Signed-off-by: Michael MacDonald <github@macdonald.cx>
f4a6d8d to
c058976
Compare
kjacque
left a comment
There was a problem hiding this comment.
LGTM, comment is just a suggestion.
| } | ||
|
|
||
| return filepath.Base(pPath), nil | ||
| return string(data[:len(data)-1]), nil // trim trailing newline |
There was a problem hiding this comment.
could use strings.Trim which might eliminate the need for the comment
In some cases, it's more reliable to get the process name from
/proc/$pid/comm, so prefer that with a fallback to the old method
of using readlink on /proc/$pid/exe.
Signed-off-by: Michael MacDonald github@macdonald.cx