pub fn force_kill(pid: u32)Expand description
Escalating kill: SIGTERM, wait grace period, then SIGKILL process group and individual PID.
Strategy:
- Send SIGTERM to give the process a chance to shut down cleanly.
- Sleep 500ms.
- If still alive, SIGKILL the process group (
kill -9 -$pid) to catch wrapper scripts and any children they spawned (e.g.redis-stack-server). - SIGKILL the individual PID as a fallback.
Uses synchronous std::process::Command so this is safe to call from Drop impls.
ยงExample
use redis_server_wrapper::process;
process::force_kill(12345);