pm2 start restarts all apps
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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