Skip to content

fix(cli): make non-root read-only commands work on Linux (EPERM liveness, sbin PATH)#11

Merged
pilat merged 1 commit into
mainfrom
fix/linux-nonroot-status
Jun 12, 2026
Merged

fix(cli): make non-root read-only commands work on Linux (EPERM liveness, sbin PATH)#11
pilat merged 1 commit into
mainfrom
fix/linux-nonroot-status

Conversation

@pilat

@pilat pilat commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Two follow-up fixes to the Linux sudo work from #9 — both the kind of thing that only shows up the first time you actually drive it as a non-root user on a real Linux box, which is exactly where they surfaced.

The headline one: after an auto-elevated fleetbox up, a plain fleetbox ls or fleetbox ssh reported the running VM as stopped. The holder liveness probe used kill(pid, 0) == nil, but a non-root user probing the root-owned holder gets EPERM (the process exists, you're just not allowed to signal it across the uid boundary) — which the code read as "dead", so it never even reached the socket and fell through to "stopped". That quietly defeated the whole point of #9, where non-root read-only commands were supposed to just work. Now EPERM counts as alive; only a genuinely absent process (ESRCH) is "not running".

The second: the CLI's auto-elevation forwards the invoking user's PATH, and a stock Debian login PATH has no /sbin. The env wrapper overrides sudo's secure_path, so the elevated holder couldn't find iptables and network setup died — it only worked on #9's test box because that shell happened to have sbin on its PATH. The elevated PATH now always carries the sbin directories.

Both were validated on real hardware — the EPERM one on a non-root Linux box (the VM flipped from "stopped" to "running" with the fix), the PATH one by dogfooding the Linux path inside a fleetbox-booted VM. ADR-0023 and the architecture notes are updated to record both.

Checklist

  • Changed the public API, package list, CLI surface, on-disk layout, or dependencies → ARCHITECTURE.md updated in this PR
  • Made a new, hard-to-reverse design decision → added an ADR under docs/adr/ (next sequential number)
  • Breaking change (! in the title) → the description spells out what callers must change

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@pilat, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 18 minutes and 49 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f865ef98-8088-419a-be7e-2f6e3e9fd5fe

📥 Commits

Reviewing files that changed from the base of the PR and between 1ad9b70 and 43a8580.

📒 Files selected for processing (7)
  • ARCHITECTURE.md
  • cmd/fleetbox/elevate.go
  • cmd/fleetbox/elevate_linux.go
  • cmd/fleetbox/elevate_test.go
  • docs/adr/0023-linux-sudo-ux.md
  • internal/control/control.go
  • internal/control/liveness_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/linux-nonroot-status

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pilat pilat merged commit 9243508 into main Jun 12, 2026
3 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.

1 participant