(pid: string | number)
| 141 | } |
| 142 | |
| 143 | function killLinuxProcessTree(pid: string | number) { |
| 144 | const targetPid = Number(pid); |
| 145 | const childPids = collectLinuxChildPids(targetPid); |
| 146 | |
| 147 | for (const childPid of childPids) { |
| 148 | execSync(`kill -s 9 ${childPid}`); |
| 149 | } |
| 150 | |
| 151 | execSync(`kill -s 9 ${targetPid}`); |
| 152 | } |
| 153 | |
| 154 | function collectLinuxChildPids(pid: number): number[] { |
| 155 | const childPids = listLinuxChildPids(pid); |
no test coverage detected