With the following simple scripts to start a child process:
one.js
console.log('One ready')
const two = require('child_process').fork('./two.js')
setTimeout(() => {}, 60000)
two.js
console.log('Two ready')
setTimeout(() => {}, 60000)
The child process two.js is able to die with the parent when using forever stop
on Windows, Debian and Ubuntu but for some reason on Alpine Linux, it leaves the child process alive. Is it possible to do something to ensure the child process is dead across every OS when the child process dies?
Also another question concerning forever restart
. This doesn't seem to be consistent across every OS either. On Windows the old parent/child process dies, but on Linux the child process stays alive no matter what (whereas with forever stop
the child process only doesn't die with Alpine Linux).
Is this something that can be fixed, or is it just better to avoid using forever to handle scripts with child processes?
via platizin
No comments:
Post a Comment