stado service watch-spawn
Invocation
stado service watch-spawn [OPTIONS] --host <HOST> --command <COMMAND>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 agent` on charless-mac-mini. 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 option | Contract |
|---|---|
--host <HOST> | Registry host to watch |
--command <COMMAND> | The program to watch for, as a substring of its command line -- for example `stado agent --target charless-mac-mini`. 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 [default: 300] |
--interval-ms <INTERVAL_MS> | Gap between samples, in milliseconds. The default catches a parent that lives about a second; tighten it for one that does not [default: 1000] |
--json | Command 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.