Repository navigation
fix(setup): probe daemon sockets without netcat - #772
Conversation
Signed-off-by: CreedTech <[email protected]>
vladimirrott
left a comment
There was a problem hiding this comment.
Running the probe through process.execPath with the path in argv drops the nc dependency without adding a shell or an npm package. Pointing PATH at an empty directory in the test is the right way to prove it: a machine without netcat is the case #755 describes. I approve this at head c7af2ea15e1e0c52df28ec31fd99f987b288fedf.
I ran your tests in node:24-slim with the network off. That image ships no nc, so it reproduces #755:
HEAD tree: 1 node-probe line(s), nc on PATH: none
== pristine full suite rc=0
# tests 137
# pass 137
# fail 0
Then two mutants in checkSocket:
- Restoring
spawnSync('nc', ['-zU', socket], { timeout: 2000 })fails your renamed test, and the output shows the bug from the issue:not ok 12 - a reachable externally managed daemon makes a skipped install complete without nc ⚠ Daemon socket not reachable after 6s: /tmp/sk-sock-24nLLE/sysknife/daemon.sock - Making the
errorhandler exit 0 (a dead socket reported as alive) fails 16 tests, includinga daemon that was not installed is reported as outstanding, whatever the reason, where your newDaemon socket not reachable after 6s:assertion lives. Both directions hold.
Both callers go through this function: the final status check after install (checkSocketWithRetry at index.js:920) and the early probe right after the socket prompt at index.js:487. A user without netcat who has a running daemon now sees Daemon socket reachable and Setup complete instead of an outstanding step. CI is green at this head. I have nothing blocking and nothing optional. I will merge it from my side and write the CHANGELOG line then.
If you want another in the same file, #563 (re-running sysknife-setup while the daemon runs fails with ETXTBSY) and #480 (--uninstall deletes the whole .mcp.json) are both open, and I will hold either for you.
Summary
The setup wizard reports a listening daemon as unreachable when
ncis absent. Probe local Unix sockets with Node's built-innetmodule instead. The subprocess keeps the existing synchronous flow and timeout, and sends no data to the daemon.Related Issue
Closes #755
Validation
The reachable-daemon regression failed on the base implementation with an empty directory on
PATH. With the fix, setup detects the listener and exits 0. The dead-socket check still reports unreachable and leaves setup incomplete.npm test --prefix packages/setup: 137 passed.python3 scripts/check_evidence_claims.pygit diff --checkNotes for Reviewers
The probe still skips vsock and non-local paths. Retry behavior is unchanged. Implementation and validation were assisted by Codex.