MCPcopy Create free account
hub / github.com/PasarGuard/node / isProcessRunning

Function isProcessRunning

backend/xray/process_unix.go:251–260  ·  view source on GitHub ↗

isProcessRunning checks if a process is still running

(pid int)

Source from the content-addressed store, hash-verified

249
250// isProcessRunning checks if a process is still running
251func isProcessRunning(pid int) bool {
252 proc, err := os.FindProcess(pid)
253 if err != nil {
254 return false
255 }
256
257 // Try to signal the process - if it fails, it's likely dead
258 err = proc.Signal(syscall.Signal(0))
259 return err == nil
260}
261
262// isProcessZombie checks if a process is a zombie on Unix
263// This is already handled in findXrayProcesses by checking the state field

Callers 2

killProcessTreeFunction · 0.70
verifyProcessDeadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected