in one terminal window, run node parent.js
in another, run tail -f test.log
with the cp.stderr.destroy line commented out, the node parent.js
process will not automatically exit. With the cp.stderr.destroy line uncommented, the parent process correctly exits and the child process is unaffected.