Summary
scripts/deploy-remote.sh relies on ss (iproute2) to check listening ports and resolve PIDs. ss is Linux-only — it is not available on macOS/OSX and cannot be installed there — so any of these code paths that execute on a developer's Mac will fail or silently misbehave.
Occurrences
All in scripts/deploy-remote.sh:
- Line 320 —
! ss -tlnp | grep -q ':8080\b' — wait for the controller to stop.
- Line 335 —
if ss -tlnp | grep -q ':8080\b'; then — detect port 8080 still in use.
- Line 337 —
ss -tlnp | grep ':8080\b' >&2 || true — diagnostic dump of 8080 listeners.
- Line 348 —
controller_pid=$(remote "ss -tlnp | sed -n '...pid=...' | head -1" ...) — resolve controller PID.
- Line 451 —
if ss -tlnp 2>/dev/null | grep -q ":${port}\b"; then — port-based service status check.
Notes
- These usages currently run inside
remote/<<'REMOTE' heredoc blocks targeting the Linux host, where ss exists, so they work today. However, the pattern is fragile: any refactor that runs these checks locally (or reuse of these snippets in a local script) will break on macOS, and the dependency on ss is not obvious from the call sites.
- macOS provides no drop-in equivalent for
ss -tlnp.
Suggested fix
Use a portable alternative that works on both Linux and macOS, e.g. lsof:
lsof -nP -iTCP:8080 -sTCP:LISTEN
lsof -ti tcp:8080 -sTCP:LISTEN # PIDs only
Alternatively, guard ss usage so it is only ever invoked on the remote host and never locally, and document that assumption.
Summary
scripts/deploy-remote.shrelies onss(iproute2) to check listening ports and resolve PIDs.ssis Linux-only — it is not available on macOS/OSX and cannot be installed there — so any of these code paths that execute on a developer's Mac will fail or silently misbehave.Occurrences
All in
scripts/deploy-remote.sh:! ss -tlnp | grep -q ':8080\b'— wait for the controller to stop.if ss -tlnp | grep -q ':8080\b'; then— detect port 8080 still in use.ss -tlnp | grep ':8080\b' >&2 || true— diagnostic dump of 8080 listeners.controller_pid=$(remote "ss -tlnp | sed -n '...pid=...' | head -1" ...)— resolve controller PID.if ss -tlnp 2>/dev/null | grep -q ":${port}\b"; then— port-based service status check.Notes
remote/<<'REMOTE'heredoc blocks targeting the Linux host, wheressexists, so they work today. However, the pattern is fragile: any refactor that runs these checks locally (or reuse of these snippets in a local script) will break on macOS, and the dependency onssis not obvious from the call sites.ss -tlnp.Suggested fix
Use a portable alternative that works on both Linux and macOS, e.g.
lsof:lsof -nP -iTCP:8080 -sTCP:LISTEN lsof -ti tcp:8080 -sTCP:LISTEN # PIDs onlyAlternatively, guard
ssusage so it is only ever invoked on the remote host and never locally, and document that assumption.