pkrumins / node-tree-kill

kill trees of processes
MIT License
333 stars 37 forks source link

No error given when kill fails #23

Open mlucool opened 5 years ago

mlucool commented 5 years ago

Given the following program:

process.on('SIGTERM', () => console.error('Ignoring'));

let n = 0;
setInterval(()=> console.log(n++), 2*1000);

I have tried to kill it using treeKill via something like

treeKill(myPID, (err) => {console.log(typeof err)})

Here I get no err because, like kill on linux, the exit code is 0 as the signal was sent successfully. Is this expected? I assume so, but it makes ensuring a process is dead a little more complex.