Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop pm2 from killing detached child processes

Tags:

node.js

spawn

pm2

pm2 is killing detached child processes on watch restart (ie which have been spawned with detached:true, stdio:'ignore', and child.unref().

Is there a way of telling pm2 not to kill the tree of child processes on restart?

like image 259
user4893295 Avatar asked Mar 08 '23 13:03

user4893295


1 Answers

The answer was to put the following in the ecosystem file (main section for app, not under the watch settings):

"treekill": false
like image 150
user4893295 Avatar answered Mar 28 '23 13:03

user4893295