CLI reference / service / watch

stado service watch

Invocation

stado service watch [OPTIONS] --host <HOST> --command <COMMAND> --seconds <SECONDS> --interval-ms <INTERVAL_MS>

Purpose

Sit on HOST and name the parent of the next process matching a program, while that parent is still alive. `reap` and `list --unowned` each take one snapshot, and a snapshot taken after a respawn can only ever report `ppid 1` — the parent backgrounded the child and exited, which is precisely why nothing could say what kept restarting an undeclared `stado serve`. Driving a snapshot from here in a loop cannot sample faster than an SSH round trip; the loop has to run on the host. Reads `ps` on an interval and prints. It signals nothing, starts nothing and writes nothing, so it is safe to leave running while somebody else works on the box.

Required inputs and options

Input or optionContract
--host <HOST>Registry host to watch
--command <COMMAND>The program to watch for, as a substring of its command line -- for example `stado serve --target <host>`. Processes matching it that are ALREADY running when the watch opens are reported as baseline and never as arrivals
--seconds <SECONDS>How long to watch, in seconds. No duration is assumed
--interval-ms <INTERVAL_MS>Gap between samples, in milliseconds: shorter than the life of the parent being caught. No gap is assumed
--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

  • 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.