pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

Create process but not start

Open darkdiesel opened this issue 1 year ago • 5 comments

Is it possible create process and not start it. Save list and then start when you need?

darkdiesel avatar Feb 18 '24 01:02 darkdiesel

You can probably use a config file for it.

https://pm2.keymetrics.io/docs/usage/application-declaration/

image

Void-Monarch avatar Feb 21 '24 07:02 Void-Monarch

That doesn't work. I opened this issue quite some time ago and never got a response: https://github.com/Unitech/pm2/issues/5711

mudmixer-wes avatar Feb 21 '24 16:02 mudmixer-wes

What is the exact use case of adding an app to the list to launch it later? Why don't you just do pm2 start ... later then?

ultimate-tester avatar Feb 29 '24 10:02 ultimate-tester

In our case, we use a CI/CD workflow that ships to production on merge. So we use Ecosystem files with cron schedules defined in the ecosystem file. Therefore, when we merge to production, deployment is automatic, but we do not want all previously defined jobs in our ecosystem to run just because we merged code to production and/or added/deleted a job with it's own cron schedule in the ecosystem file.

mudmixer-wes avatar Feb 29 '24 15:02 mudmixer-wes

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

Let's go!

mudmixer-wes avatar May 24 '24 12:05 mudmixer-wes

Wow! Thanks a lot!

darkdiesel avatar May 24 '24 13:05 darkdiesel