Unitech / Unitech/pm2

pm2 start restarts all apps

Open
#5,626 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

When I run the pm2 start pm2.json command, it restarts all of the apps in my ecosystem file. Is this expected behavior? I only want apps that are not already running in my pm2.json file to start running, and ones that are, to keep running and not restart. Each app does use the same code.

example pm2.json

{
  "apps": [
    {
      "name": "my app that is already running",
      "script": "./app.js",
      "args": "-a EVC7781",
      "max_memory_restart": "300M",
      "out_file": "/var/www/html/logs/EVC7781-out.log",
      "error_file": "/var/www/html/logs/EVC7781-error.log",
      "kill_timeout": 5000,
      "restart_delay": 5000,
      "shutdown_with_message": true
    },
    {
      "name": "my new app I just added and want to run",
      "script": "./app.js",
      "args": "-a EVC8326",
      "max_memory_restart": "300M",
      "out_file": "/var/www/html/logs/EVC8326-out.log",
      "error_file": "/var/www/html/logs/EVC8326-error.log",
      "kill_timeout": 5000,
      "restart_delay": 5000,
      "shutdown_with_message": true
    }
  ]
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing pm2 start pm2.json with the two-app example and inspect how the command handles already running ecosystem entries. Done means newly added apps start while apps already running from the file continue without being restarted.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.