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

Function isProcessAlive

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

Source from the content-addressed store, hash-verified

670 * mistake a live daemon for a dead one and clear its lock.
671 */
672export function isProcessAlive(pid: number): boolean {
673 try {
674 process.kill(pid, 0);
675 return true;
676 } catch (err: unknown) {
677 const e = err as NodeJS.ErrnoException;
678 if (e.code === 'EPERM') return true; // exists, just not ours to signal
679 return false;
680 }
681}
682
683/**
684 * 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