MCPcopy Index your code
hub / github.com/callstack/agent-device / isAgentDeviceDaemonProcess

Function isAgentDeviceDaemonProcess

src/utils/process-identity.ts:67–76  ·  view source on GitHub ↗
(pid: number, expectedStartTime?: string)

Source from the content-addressed store, hash-verified

65}
66
67export function isAgentDeviceDaemonProcess(pid: number, expectedStartTime?: string): boolean {
68 if (!isProcessAlive(pid)) return false;
69 if (expectedStartTime) {
70 const actualStartTime = readProcessStartTime(pid);
71 if (!actualStartTime || actualStartTime !== expectedStartTime) return false;
72 }
73 const command = readProcessCommand(pid);
74 if (!command) return false;
75 return isAgentDeviceDaemonCommand(command);
76}
77
78function trySignalProcess(pid: number, signal: NodeJS.Signals): boolean {
79 try {

Callers 7

resetDaemonAfterTimeoutFunction · 0.90
recoverDaemonLockHolderFunction · 0.90
acquireDaemonLockFunction · 0.90
hasLiveDaemonFunction · 0.90
stopProcessForTakeoverFunction · 0.85

Calls 4

isProcessAliveFunction · 0.85
readProcessStartTimeFunction · 0.85
readProcessCommandFunction · 0.85

Tested by

no test coverage detected