MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / killLinuxProcessTree

Function killLinuxProcessTree

common/src/process_tools.ts:143–152  ·  view source on GitHub ↗
(pid: string | number)

Source from the content-addressed store, hash-verified

141}
142
143function 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
154function collectLinuxChildPids(pid: number): number[] {
155 const childPids = listLinuxChildPids(pid);

Callers 1

killProcessFunction · 0.85

Calls 1

collectLinuxChildPidsFunction · 0.85

Tested by

no test coverage detected