Skip to content

fix: name the package to install when ss or ps is missing - #84

Merged
OhadC merged 2 commits into
mainfrom
missing-scan-tools
Nov 21, 2026
Merged

OhadC merged 2 commits into
mainfrom
missing-scan-tools

Conversation

@OhadC

@OhadC OhadC commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

 OsCommand.run(file, args)
+  ENOENT -> { status: "not found" }
 OsCommand.output(run, file, args)
   fine status -> stdout
-  else throw "leeway: <file> failed: <stderr>"
+  else throw failure(file, result)
+    ss or ps, not found or BusyBox stderr -> "leeway: install iproute2 for ss" / "leeway: install procps for ps"
+    any other tool not found              -> "leeway: <file> failed: not found on PATH"
+    otherwise                             -> "leeway: <file> failed: <stderr>"

README Limits gains one bullet: on Linux, leeway list, leeway kill and leeway release need ss (iproute2); list and kill need ps (procps; BusyBox ps won't do).

The ticket says only list and kill need ss. release needs it too: it lists the orphans it leaves behind. A claim (env, move, leeway <command>) still works without either tool.

Evidence

  • Before (linux, PATH without ss): leeway list -> leeway: ss failed: spawnSync ss ENOENT; without ps: leeway: ps failed: spawnSync ps ENOENT. The new Linux CLI tests failed with exactly these.
    After: leeway: install iproute2 for ss / leeway: install procps for ps, exit 1, for both list and kill; leeway env still exits 0.
  • BusyBox: unit test against the real stderr from node:22-alpine (ps: unrecognized option: w + BusyBox usage). Also checked by hand in node:22-alpine with iproute2 added and a listener in the range: list and kill both print leeway: install procps for ps.
  • pnpm verify and pnpm test:linux green.

Merge Danger

Door: two-way

Blast Radius: small

Only the error text changes, and only for scans that already fail. leeway kill <orphan port> without ps reports the procps line per pid on stdout, not as one stderr line.

Closes #78

@OhadC

OhadC commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Written by Claude (AI assistant) on behalf of @OhadC.

Review by a separate agent: acceptance criteria of #78 met, nothing blocking. No change made after review.

Finding Outcome
leeway release without ss frees the range, then exits 1 with the iproute2 line and never prints "released" left: older than this PR, the fix is in cli.ts which #83 is changing; the README line here says release needs ss
leeway kill <orphan port> without ps reports per pid on stdout, failed: leeway: install procps for ps, not one stderr line left: it names the package and exits 1; the doubled prefix is cosmetic
The BusyBox match is not limited to Linux left: macOS ships ps, and a procps failure never prints "BusyBox"
Package names are Debian and Alpine ones; Fedora has iproute and procps-ng left: the ticket fixed the names; the tool is named too
status: "not found" beside `number null`
The ps-missing test finds ss with command -v left: holds in CI and in the test:linux container
A missing netstat, powershell.exe or lsof now reads not found on PATH kept: clearer than spawnSync ... ENOENT, same exit

# Conflicts:
#	packages/leeway/test/cli-list-kill.test.ts
@OhadC
OhadC merged commit 54a3c3e into main Nov 21, 2026
12 checks passed
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.

leeway list and kill do not say what to install when ss or ps is missing

1 participant