Search code examples
node.jspm2spawn

How to stop pm2 from killing detached child processes


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?


Solution

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

    "treekill": false