Node.JS child processes being killed when parent dies

前端 未结 1 599
自闭症患者
自闭症患者 2020-12-17 16:38

I am using child_process.spawn() to start a script from my Node.JS application running on Ubuntu. As far as I know, standard forked or spawned *nix processes don\'t generall

1条回答
  •  不思量自难忘°
    2020-12-17 16:57

    you need to set the detached option

    If the detached option is set, the child process will be made the leader of a new process group. This makes it possible for the child to continue running after the parent exits.

    var child = spawn('prg', [], {
       detached: true,
       stdio: [ 'ignore', out, err ]
     });
    

    0 讨论(0)
提交回复
热议问题