node-tree-kill icon indicating copy to clipboard operation
node-tree-kill copied to clipboard

No error given when kill fails

Open mlucool opened this issue 6 years ago • 0 comments

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.

mlucool avatar Jul 12 '18 20:07 mlucool