Expand description
Cross-platform process-management primitives.
Wire historically called pgrep + kill directly, which gave us
“unsupported platform” rot on Windows. v0.7.3 funnels every
liveness check / command-line search / SIGTERM through this module
so the Windows daemon + relay paths get the same teardown +
respawn behavior the Linux + macOS paths have always had.
§Helpers
process_alive— “is pidstill around?” find_processes_by_cmdline—pgrep -f <pattern>equivalentkill_process— SIGTERM / SIGKILL equivalent (taskkill /T on Windows so the tree dies, not just the parent)
Each helper returns conservative defaults on tool failure (empty
Vec, false) so callers can chain them without aborting an upgrade
mid-flight when one query hiccups.
Functions§
- find_
processes_ by_ cmdline pgrep -f <pattern>equivalent: every pid whose command line containspattern. Empty Vec on tool error or zero matches.- kill_
process - Signal a pid to exit. Returns true on successful dispatch (NOT on
confirmed exit — poll
process_alivefor that).force=trueis SIGKILL /taskkill /F;force=falseis SIGTERM /taskkill(graceful). - process_
alive - True iff pid is alive.