#1075·OpenJarvis

serve: stale server.pid with a reused PID blocks startup on Linux/WSL

Author: wagnerglorenzCreated Oct 1, 2026Updated Oct 1, 2026

Component: src/openjarvis/cli/daemon_cmd.py (_write_pid_unlocked), core/utils.py::process_alive

After a WSL/Linux restart ~/.openjarvis/server.pid still holds the old PID. When the kernel later hands that PID to an unrelated process, process_alive(pid) is true and startup fails with RuntimeError: Another server is already registered (PID N); a systemd unit then restart-loops. This is not the Windows trampoline problem in #1062: here the recorded process is alive but is not a jarvis server.

Suggested fix: when the pid is alive, also compare the process start time (or check that /proc/<pid>/cmdline contains openjarvis/jarvis serve) before treating the registration as live. Our workaround is deleting server.pid/server.json in an ExecStartPre step. I have not written a patch yet; glad to if the approach sounds right.

Generated with Claude Code