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

Function isProcessAlive

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

Source from the content-addressed store, hash-verified

664 * mistake a live daemon for a dead one and clear its lock.
665 */
666export function isProcessAlive(pid: number): boolean {
667 try {
668 process.kill(pid, 0);
669 return true;
670 } catch (err: unknown) {
671 const e = err as NodeJS.ErrnoException;
672 if (e.code === 'EPERM') return true; // exists, just not ours to signal
673 return false;
674 }
675}
676
677/**
678 * The one `listen()` error we must NOT relocate past. EADDRINUSE means the path

Callers 2

startDaemonProcessMethod · 0.90
clearStaleDaemonLockFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected