Skip to main content

Module platform

Module platform 

Source
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

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 contains pattern. 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_alive for that). force=true is SIGKILL / taskkill /F; force=false is SIGTERM / taskkill (graceful).
process_alive
True iff pid is alive.