MCPcopy
hub / github.com/coder/mux / isProcessAlive

Method isProcessAlive

src/node/services/serverLockfile.ts:120–127  ·  view source on GitHub ↗

* Check if a process with the given PID is still running. * Uses signal 0 which tests existence without actually sending a signal.

(pid: number)

Source from the content-addressed store, hash-verified

118 * Uses signal 0 which tests existence without actually sending a signal.
119 */
120 private isProcessAlive(pid: number): boolean {
121 try {
122 process.kill(pid, 0);
123 return true;
124 } catch {
125 return false;
126 }
127 }
128
129 /**
130 * Get the path to the lockfile (for testing/debugging).

Callers 1

readMethod · 0.95

Calls 1

killMethod · 0.65

Tested by

no test coverage detected