MCPcopy Index your code
hub / github.com/colbymchenry/codegraph / isProcessAlive

Function isProcessAlive

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

Source from the content-addressed store, hash-verified

634 * mistake a live daemon for a dead one and clear its lock.
635 */
636export function isProcessAlive(pid: number): boolean {
637 try {
638 process.kill(pid, 0);
639 return true;
640 } catch (err: unknown) {
641 const e = err as NodeJS.ErrnoException;
642 if (e.code === 'EPERM') return true; // exists, just not ours to signal
643 return false;
644 }
645}
646
647/**
648 * 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