Snakepit.ProcessKiller (Snakepit v0.6.10)
View SourceRobust OS process management using Erlang primitives. No shell commands, pure Erlang/Elixir.
This module provides POSIX-compliant process management that works across Linux, macOS, and BSD systems without relying on shell-specific features like pkill.
Summary
Functions
Finds all Python processes on the system. Returns a list of OS PIDs.
Gets the command line of a process. POSIX-compliant using /proc on Linux, ps on macOS/BSD.
Kills all processes matching a run ID. Pure Erlang implementation, no pkill.
Kills a process by PID using proper Erlang signals.
Kills a process with escalation: SIGTERM -> wait -> SIGKILL
Checks if a process is alive. Uses kill -0 (signal 0) which doesn't kill but checks existence.
Functions
Finds all Python processes on the system. Returns a list of OS PIDs.
Gets the command line of a process. POSIX-compliant using /proc on Linux, ps on macOS/BSD.
Kills all processes matching a run ID. Pure Erlang implementation, no pkill.
Kills a process by PID using proper Erlang signals.
Parameters
os_pid: OS process ID (integer)signal: :sigterm | :sigkill | :sighup
Returns
:okif kill succeeded{:error, reason}if kill failed
Kills a process with escalation: SIGTERM -> wait -> SIGKILL
Checks if a process is alive. Uses kill -0 (signal 0) which doesn't kill but checks existence.