fxctl is a pure POSIX client that links nothing from vendor. It maps a subcommand to a single newline-terminated request line over $FX_RUN/control.sock (default /run/fx) and streams the response lines to stdout, terminating on OK (exit 0) or ERR <msg> (exit 1).
fxctl never opens a datalog DB directly. The actor / sole-writer model is enforced structurally: dl_open takes a process-lifetime exclusive fcntl lock, so direct access would block fx-init. Every read goes through the socket.
| Subcommand | Action |
|---|---|
| status | composed boot_status + generation_current + service_runtime snapshot. |
| q <rel> [v..] | runtime relation query (all tuples, or a bound prefix). |
| start|stop|restart <svc> | service control; recorded as a control(txn,cmd,target) fact. |
| probe | refresh the OS probe relations now. |
| activate <config> | init forks fx-activate (never shell system()); prints the new version. |
| rollback <v> | roll-forward to a known-good version; restores its M4 facts first. |
| shutdown | orderly SIGTERM-style shutdown. |
| grep <regex> | log regex search. |
| search <term>.. | log full-text AND search. |
The runtime DB holds the live, queryable state fx-init writes each loop:
| Relation | Arity |
|---|---|
| generation_current | 1 — the booted version. |
| boot_status | 2 — (version, in-progress|ok|failed). |
| service_runtime | 4 — (name, pid, state, restarts). |
| ready | 1 — service names that are ready. |
| control | 3 — (txn, cmd, target) audit of control commands. |
| effect | 3 — (txn, key, val) command effects. |