I’m using child_process.spawn/child_process.fork to start a number of child processes from a node.js application. When stopping the parent process with Ctrl-C the child processes are stopped too. Is there an elegant way to keep the child processes running?
I’m using child_process.spawn/child_process.fork to start a number of child processes from a node.js application.
Share
You could try catching
SIGINTin your child:Run
parent.jsand press^C. Yourchild.jsshould continue running in the background. I don’t know what the effects of this will be during the lifetime ofchild.js.Here is an enlightening, albeit pretty old, discussion of the topic on the node.js mailing list.