Skip to content

[#728] Detect busy ports on macOS in check.sh - #729

Open
lookslikeameya wants to merge 1 commit into
pgexporter:mainfrom
lookslikeameya:728-check-sh-port-macos
Open

lookslikeameya wants to merge 1 commit into
pgexporter:mainfrom
lookslikeameya:728-check-sh-port-macos

Conversation

@lookslikeameya

Copy link
Copy Markdown
Contributor

Closes #728

macOS has no ss, so check.sh saw every port as free and never moved off a busy test port. The new port_in_use() uses ss when it is available, so Linux behaves as before, and falls back to lsof otherwise. All three port checks use it.

Testing (macOS arm64):

  • 6432 busy: "Port 6432 is already in use; using port 6433 instead"
  • 6432 free: uses 6432 as before
  • 5002 busy: stops with "Port 5002 still in use after cleanup" (before, this was not detected)
  • Linux (Rocky 10 container with iproute): ss path still detects a busy port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test/check.sh does not detect a busy port on macOS because ss is not available

1 participant