# `Snakepit.ProcessKiller`
[🔗](https://github.com/nshkrdotcom/snakepit/blob/v0.13.0/lib/snakepit/process_killer.ex#L1)

Robust 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.

# `find_python_processes`

Finds all Python processes on the system.
Returns a list of OS PIDs.

# `get_process_command`

Gets the command line of a process.
POSIX-compliant using /proc on Linux, ps on macOS/BSD.

# `get_process_group_id`

Gets the process group ID (PGID) for a process.

# `kill_by_run_id`

Kills all processes matching a run ID.
Pure Erlang implementation, no pkill.

# `kill_process`

Kills a process by PID using proper Erlang signals.

## Parameters
- `os_pid`: OS process ID (integer)
- `signal`: :sigterm | :sigkill | :sighup

## Returns
- `:ok` if kill succeeded
- `{:error, reason}` if kill failed

# `kill_process_group`

Kills a process group by PGID using proper Erlang signals.

## Parameters
- `pgid`: Process group ID (integer)
- `signal`: :sigterm | :sigkill | :sighup

# `kill_process_group_with_escalation`

Kills a process group with escalation: SIGTERM -> wait -> SIGKILL.

# `kill_with_escalation`

Kills a process with escalation: SIGTERM -> wait -> SIGKILL

# `process_alive?`

Checks if a process is alive.
Uses kill -0 (signal 0) which doesn't kill but checks existence.

# `process_group_supported?`

Returns true if the platform supports process group kill semantics.

# `setsid_executable`

Returns the path to the setsid executable, or {:error, :not_found}.

# `setsid_executable!`

Returns the setsid executable path or raises if not available.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
