Skip to content

Commit 2b37734

Browse files
committed
cli: exempt ps from the startup proot probe
ps only reads the session registry and prunes dead entries; it never invokes proot. Its companion kill was already exempt with exactly this rationale, so requiring proot for ps was an inconsistency: on a system without proot you could kill tracked sessions but not list them.
1 parent e4ab802 commit 2b37734

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ numeric uid, or `user:group`.
151151
2. Root warn (non-fatal); nested-proot reject (reads
152152
`/proc/<pid>/status`, follows one TracerPid hop).
153153
3. proot probe; on Termux + TTY, offers `pkg install`. **`build`,
154-
`push`, and `kill` are exempt** (`kill` only signals running
155-
sessions); `build` runs its own gate via
154+
`push`, `kill`, and `ps` are exempt** (`kill`/`ps` only signal or
155+
read running sessions); `build` runs its own gate via
156156
`build_engine.needs_proot()` (True only with a RUN-family).
157157
4. Per-command `-h`/`--help`/`--usage` intercepted **before** argparse
158158
so missing positionals never produce errors instead of help. Unknown

proot_distro/cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,11 @@ def _ensure_proot_available(first_canonical: str) -> None:
174174
`push` only reads from the local manifest/layer cache and uploads
175175
to a registry. `build` runs its own check after parsing the
176176
Dockerfile and refuses only when RUN (or ONBUILD RUN) is actually
177-
present. `kill` is exempt too: it only signals already-running
178-
sessions and never invokes proot.
177+
present. `kill` and `ps` are exempt too: they only inspect and
178+
signal already-running sessions via the session registry and never
179+
invoke proot.
179180
"""
180-
if first_canonical in ("build", "push", "kill"):
181+
if first_canonical in ("build", "push", "kill", "ps"):
181182
return
182183
ensure_proot_installed()
183184

0 commit comments

Comments
 (0)