Expand description
Shared kill-by-lock-owner logic for the {api,db,mcp,viewer} kill
commands.
A server’s identity on disk is the lockfile it holds: the api at
<dir>/bin/locks key api (machine-wide, one lock), and db /
mcp / viewer at <dir>/state/<state>/locks keyed db / mcp /
viewer (per state). Killing a server means reading the live
owner PIDs of that lockfile via objectiveai_sdk::lockfile::owners
and terminating them — for db, killing the supervisor takes the
postmaster with it (job object / PR_SET_PDEATHSIG).
Functions§
- kill_
lock_ owners - Read the owner PIDs of
(locks_dir, key)and kill each. Returns the count actually terminated. A lockfile with no live owner yields zero — idempotent. - kill_
per_ state - Kill the per-state lockfile owners for
keyacross the scope:--statehits only the currentOBJECTIVEAI_STATE;--globalfans out across every<dir>/state/<name>/locksconcurrently and sums the kills.