fix(process): resolve shells and the process table portably; keep the sandboxed kill honest #68
Loading…
Reference in a new issue
No description provided.
Delete branch "taha/w-proc-process-shell-portability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fix(bash): prefer /bin/bash where it exists, then the first bash on PATH, and refuse with a clear error when neither exists - no silent sh fallback.\n\nfix(process/runtime): read /proc//stat and cmdline on Linux for kill verification (ps is missing on NixOS and in container images); zombies stay "gone" and an empty command line stays an error. The ps path stays for unix platforms without /proc.\n\nfix(process/remote): the endpoint launcher resolves bash (/bin/bash first, then PATH) instead of hardcoding it, and records exit 127 with an error when no bash exists instead of dying and leaving the record "running" for ever. The launcher lookup helper reads /proc on Linux.\n\nfix(process/sandboxed): the kill tree walk recursed inside a shell for-loop whose variable the recursion clobbered, so only the leader and the deepest leaf were signalled and a kill reported success while the command shell kept running; the pending pids now travel in the positional parameters. The status script re-reads the exit file with a bounded grace before reporting an unknown exit, because the subshell writes the exit code with an external mv and then exits.\n\nEvery fix has a regression test proven red against the old behaviour (reverted hunk, failing assertion, restored). Validated with go build ./..., go vet, go test -race -count=1 on internal/tool/bash, internal/process/runtime, internal/process/remote and internal/process/sandboxed, CGO_ENABLED=0 GOOS=darwin vet/test-compile, and gofmt on the changed paths.
Pull request closed