diff options
| author | Jesse Vincent <jesse@primeradiant.com> | 2026-06-09 14:57:44 -0700 |
|---|---|---|
| committer | Drew Ritter <drew@primeradiant.com> | 2026-06-16 10:09:45 -0700 |
| commit | 5ddce063df0b018ef1e972177919b302d1c3430e (patch) | |
| tree | cd9ecf23cbb148d0485c34ad24d697e2c1a9f179 /tests/opencode/test-plugin-loading.sh | |
| parent | 2b108b7dc2896df01a58384a3ff46e71ba04e9e2 (diff) | |
fix(brainstorm-server): verify PID ownership before stopping
stop-server.sh read server.pid and SIGKILL'd that PID with no checks. After a
reboot or PID wraparound the pid file can point at an unrelated, live process —
which we would then kill.
Verify the PID is actually our server (a running 'node ... server.cjs') before
signalling it. If ownership can't be proven, fail closed: remove the stale pid
file and report {status: stale_pid} without killing anything. Real servers still
stop ({status: stopped}); a missing pid file still reports not_running.
Adds stop-server.test.sh covering: an unrelated reused PID is left alone, a real
server is stopped, and a missing pid file.
Refs #1703
Diffstat (limited to 'tests/opencode/test-plugin-loading.sh')
0 files changed, 0 insertions, 0 deletions
