unarr/internal/agent/process_unix.go
Deivid Soto 35e5298f23 feat: add clean command to remove temp files, logs, and cached data
Adds `unarr clean` with interactive confirmation, --dry-run, --yes,
and --all flags. Safely skips recent usenet resume files (<7 days) to
preserve download progress. Includes platform-specific PID detection
(Unix signal 0 / Windows heartbeat heuristic), CleanableBytes callback
for future heartbeat reporting, and uses shared ui.FormatBytes.
2026-03-29 11:04:51 +02:00

11 lines
278 B
Go

//go:build !windows
package agent
import "syscall"
// IsProcessAlive checks if a process with the given PID is running.
// On Unix, sends signal 0 which checks existence without affecting the process.
func IsProcessAlive(pid int) bool {
return syscall.Kill(pid, 0) == nil
}