I use child_process.spawn () to run a script from my Node.JS application running on Ubuntu. As far as I know, standard * nix forked or spawned processes usually donβt die when the parent dies, but when spawning processes from Node.JS spawn, they seem to die when my application crashes or ctrl-c is interrupted, etc.
Why is this a way around this? I cannot find any obvious option in the child_process API.
My application launches several rather lengthy tasks that must be performed in the background, and if my node server crashes or restarts for some other reason, I do not want to interrupt the tasks, instead I want the node server to return and gracefully resume monitoring the execution of these running tasks.
Jhh
source share