Skip to main content

Module node_control

Module node_control 

Source
Expand description

Local control channel of this node (POST /control/{drain,reload,handoff} on the ops HTTP listener). Owner-only: a random bearer token written 0600 (Unix) into the node’s own state directory, a per-user location on Windows. /health publishes the token file path and the capabilities, never the token.

  • drain: mark the node draining (reported in /health); new work is the caller’s to stop sending. ?draining=false clears it.
  • reload: no hot-reloadable config yet; answers what needs a handoff.
  • handoff: drain, answer 202, then after release_after_ms stop the ops listener, which runs the node’s normal graceful shutdown (its own PTY sessions stop; nothing it did not spawn is touched) and frees every port for the successor.

Constants§

CAPABILITIES

Functions§

authorized
cleanup
Remove our token file at exit if it is still ours.
execute
Execute a verb. Returns (status, JSON body).
handoff_requested
Resolves when a handoff asked the ops listener to stop.
install
Create the token and write it owner-only. Call once at start.
installed
is_draining
token_file
token_file_for
Token file beside the node state.
write_owner_only