title: pm2 disconnect kills current running process
body: <p>hey stackoverflow community,</p>
  
  <p>i have running a app with pm2, in this app it has a rest api with witch i can install other apps from a source. the install part works fine but on the end of the script i call pm2 programmatically to start the new process, after start the script kill pm2 the app with the api.</p>
  
  <p>here is my startup code:</p>
  
  <pre><code>pm2.connect(function(err) {
  
       pm2.startJson(path, function(err, proc) {
          if (err) throw new Error('err');
  
          // Disconnect to PM2
          pm2.disconnect(function() { 
  
          process.exit(0);
  
          });
      });
  
  });
  </code></pre>
  
  <p>why kill pm2 my current running process?</p>
  
  <p>thanks for help</p>