pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

Issue with PM2 and SSH connection

Open NTTAKR opened this issue 3 years ago • 1 comments

I am using PM2 to watch/run my node.js application on a windows server 2019. For deployment I do:

  1. pm2 delete all
  2. git pull origin
  3. pm2 resurrect

This correctly restarts all 3 processes of my app with the saved configuration.

Sometimes there are some "ghost" processes remaining active that produce mixed results (new code and old code running in parallel). So I have decided to add a taskkill /FI "imagename eq node.exe" /F before the resurrect. This effectively kills all remaining processes (unfortunately also the pm2 daemon process).

I start this deployment via a SSH connection to the server.

If I now start the PM2 daemon process and do the resurrect it all seems well. Until I logoff via SSH. Then the daemon process and its children get killed.

How can I start the daemon process so that it does not run on the current ssh connection process?

NTTAKR avatar Aug 03 '22 09:08 NTTAKR

https://pm2.keymetrics.io/docs/usage/startup/

faulander avatar Aug 31 '22 08:08 faulander