# fxctl $ fxctl status

fxctl

The control / query plane

// one request line over /run/fx/control.sock

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.

Subcommands

// status · q · start/stop/restart · probe · activate · rollback · shutdown · grep · search
SubcommandAction
statuscomposed 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.
proberefresh 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.
shutdownorderly SIGTERM-style shutdown.
grep <regex>log regex search.
search <term>..log full-text AND search.

The runtime relations

// what fxctl can query

The runtime DB holds the live, queryable state fx-init writes each loop:

RelationArity
generation_current1 — the booted version.
boot_status2 — (version, in-progress|ok|failed).
service_runtime4 — (name, pid, state, restarts).
ready1 — service names that are ready.
control3 — (txn, cmd, target) audit of control commands.
effect3 — (txn, key, val) command effects.