CLI reference / service / reap

stado service reap

Invocation

stado service reap [OPTIONS] --host <HOST> --command <COMMAND>

Purpose

End the duplicate copies of one program on HOST that no declared label holds. Every process whose command line contains `--command` and that executes out of a managed root, or runs with its working directory under one, is listed. A row a declared launchd label or systemd unit holds is `kept` and never signalled; on Linux that includes every process in the declared unit's cgroup. Every other row reads `would_end` until `--apply` sends it SIGKILL and waits for it to exit.

Required inputs and options

Input or optionContract
--host <HOST>Registry host to reap. Required: this signals processes
--command <COMMAND>The exact program being de-duplicated, as a substring of its command line -- for example `stado serve --target <host>`. Required, and deliberately not defaulted: a fleet-wide reap on that host proposed ending `skarbiec serve`, `stado serve` and the Weles API server, because launchd holds a pid for only some declared labels and everything else read as undeclared
--applySend SIGKILL to the rows a declared unit does not hold and wait for each to exit. Without it those rows read `would_end`; a `kept` row is never signalled with or without this flag, and is reported so the program a declared unit is running can be named
--jsonCommand option; required or optional as shown in the invocation.

Output and state effect

It performs the operation described above and emits its operator result on standard output or standard error. Any state change is limited to the resources and records named by the purpose and options on this page.

Refusals

  • Required: this signals processes
  • Required, and deliberately not defaulted: a fleet-wide reap on that host proposed ending `skarbiec serve`, `stado serve` and the Weles API server, because launchd holds a pid for only some declared labels and everything else read as undeclared
  • Before dispatch, Stado refuses a missing required token shown in the invocation, an unknown option, or a value outside a listed value set; argument-usage failures exit with code 2.