(pid: number, expectedStartTime?: string)
| 65 | } |
| 66 | |
| 67 | export 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 | |
| 78 | function trySignalProcess(pid: number, signal: NodeJS.Signals): boolean { |
| 79 | try { |
no test coverage detected