MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isProcessAlive

Function isProcessAlive

src/mcp/daemon.ts:967–976  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

965 * mistake a live daemon for a dead one and clear its lock.
966 */
967export function isProcessAlive(pid: number): boolean {
968 try {
969 process.kill(pid, 0);
970 return true;
971 } catch (err: unknown) {
972 const e = err as NodeJS.ErrnoException;
973 if (e.code === 'EPERM') return true; // exists, just not ours to signal
974 return false;
975 }
976}
977
978/**
979 * The one `listen()` error we must NOT relocate past. EADDRINUSE means the path

Callers 4

makeFallbackEngineFunction · 0.90
outwaitCandidateFunction · 0.90
startDaemonProcessMethod · 0.90
clearStaleDaemonLockFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected