fix(manage): node list on macOS (no timeout binary), ssh -n in the loop #224

Merged
jfraeys merged 1 commit from jfraeys/fix/manage-no-timeout-binary into main 2026-10-16 13:02:30 -04:00
Owner

./manage node list reported every node unreachable on macOS because its port check used 'timeout 2 bash -c exec 3<>/dev/tcp/...' and macOS has no timeout. The only two uses of the timeout command in the repo are in scripts/lib/manage/node.sh; both now call tcp_port_open (scripts/lib/manage/core.sh), pure bash with a bounded wait (not nc: macOS nc -w does not bound the connect, so an unroutable address hung). With the check working, the per-node ssh in the loop read the remaining nodes from stdin and the loop ended after the first node: ssh -n.

Checked: scripts/tests/test-tcp-port-open.sh (open, closed, unroutable within the limit, no timeout calls left; added to lint.yml); ./manage node list from a worktree with the real inventory shows web and services reachable. Not changed: the CLI column shows 'unknown' (version string does not match x.y.z); cosmetic.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ

./manage node list reported every node unreachable on macOS because its port check used 'timeout 2 bash -c exec 3<>/dev/tcp/...' and macOS has no timeout. The only two uses of the timeout command in the repo are in scripts/lib/manage/node.sh; both now call tcp_port_open (scripts/lib/manage/core.sh), pure bash with a bounded wait (not nc: macOS nc -w does not bound the connect, so an unroutable address hung). With the check working, the per-node ssh in the loop read the remaining nodes from stdin and the loop ended after the first node: ssh -n. Checked: scripts/tests/test-tcp-port-open.sh (open, closed, unroutable within the limit, no timeout calls left; added to lint.yml); ./manage node list from a worktree with the real inventory shows web and services reachable. Not changed: the CLI column shows 'unknown' (version string does not match x.y.z); cosmetic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
fix(manage): node list works on macOS (no timeout binary; ssh -n so the loop is not swallowed)
All checks were successful
Lint / lint (pull_request) Successful in 2m19s
Secret scan / scan (pull_request) Successful in 14s
17a1689b76
manage called 'timeout N bash -c exec 3<>/dev/tcp/..' for its port-22 checks; macOS has no timeout, so every node read
as unreachable. New tcp_port_open (pure bash, bounded wait; nc is not used because macOS nc -w does not bound the
connect). Fixing that exposed the per-node ssh swallowing the rest of the node list from stdin: ssh -n.
Test: test-tcp-port-open.sh (in lint.yml).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/infra!224
No description provided.