- This question is about the basic processing of O / S node.js and affects Mac and Linux.
- It deals with node.js 0.10.39, but the document is immutable from 4.0.0 (presumably there too)
The node.js manual says:
If a separate parameter is set, the child process will become the leader of the new process group. This allows the child to continue running after the parent element exits.
By default, the parent will wait for an individual child to exit. so that the parent does not expect this child, use the child.unref () method, and the parent event loop will not include the child in the reference count.
When you start the node.js child process as disconnected and not fixed, with a separate stdio as follows:
var child = spawn('prg', [], {
detached: true,
stdio: [
'ignore',
fs.openSync( updateOutputFile, "w" ),
fs.openSync( updateErrorFile, "w" )
]
}
child.unref();
, lsof , TCP/IP (), , . , .
?