pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

pm2 save without starting first

Open shaharmor opened this issue 9 years ago • 8 comments
trafficstars

Hi,

We want to be able to pm2 save a state without first being in that state.

So if we have a file processes.json, we want to start all the processes listed there but only after a reboot. Today we do:

pm2 start processes.json
pm2 save

but that causes the processes to run before we have time to reboot the server.

Any chance to do something like pm2 save processes.json which will save the "future" state of those processes? or just start them after the reboot?

shaharmor avatar Nov 09 '16 14:11 shaharmor

You should be able to start the processes.json and do a pm2 save only once (after the process is save until you re-execute a pm2 save), should be good enough no ?

vmarchaud avatar Nov 09 '16 14:11 vmarchaud

But I don't want the processes to start now, I want to to start after a reboot

shaharmor avatar Nov 09 '16 15:11 shaharmor

+1

xtramath avatar Jun 22 '17 21:06 xtramath

This is something I also have been trying to do. A suggestion: pm2 create which would have the same arguments as pm2 start but not actually start the process.

sa-0001 avatar Mar 02 '18 09:03 sa-0001

+1

lspiehler avatar May 22 '18 20:05 lspiehler

+1

mz8i avatar Oct 23 '18 09:10 mz8i

+1

bitflut avatar Apr 03 '19 10:04 bitflut

I'm going through the issues to find mentions about not auto-starting a new process, which I now created a PR for: #5780

ultimate-tester avatar Mar 08 '24 19:03 ultimate-tester

Feature landed

Update PM2 to 5.4.0

$ npm install [email protected] -g
$ pm2 update

Unitech avatar May 24 '24 12:05 Unitech