From 5923faf06c8d87e8705dff4b4df2852f787a1d7f Mon Sep 17 00:00:00 2001 From: Ivan Milchev Date: Fri, 29 Nov 2024 12:20:54 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20consistent=20processes=20executa?= =?UTF-8?q?ble=20for=20unix=20and=20linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ivan Milchev --- providers/os/resources/processes/unixps.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/providers/os/resources/processes/unixps.go b/providers/os/resources/processes/unixps.go index 12319c2771..5202b035c0 100644 --- a/providers/os/resources/processes/unixps.go +++ b/providers/os/resources/processes/unixps.go @@ -54,16 +54,17 @@ type ProcessEntry struct { } func (p ProcessEntry) ToOSProcess() *OSProcess { - executable := "" + executablePath := "" args, err := shellquote.Split(p.Command) if err == nil && len(args) > 0 { - executable = args[0] + executablePath = args[0] } + executablePathParts := strings.Split(executablePath, "/") return &OSProcess{ Pid: p.Pid, Command: p.Command, - Executable: executable, + Executable: executablePathParts[len(executablePathParts)-1], State: "", } }