pm2
pm2 copied to clipboard
when running npm commands, the process name is always shell
What's going wrong?
I am trying to run several projects with pm2 using npm scripts, but each process name is always "shell" even when explicitly set in a json config.
How could we reproduce this issue?
have a config like
{
"apps": [
{
"name": "api-server",
"script": "npm",
"args": "run start"
},
}
and notice that the process's name is "shell" and not "api-server"
Supporting information
--- PM2 report ----------------------------------------------------------------
Date : Tue Oct 15 2024 11:41:29 GMT-0400 (Eastern Daylight Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 5.4.2
node version : 20.17.0
node path : /nix/store/90wa8dsnqbr9fd3kybk9ir1kf82bfrqa-pm2-5.4.2/bin/pm2
argv : /nix/store/w78sh036dyn14f29w8za9ni9syrmwm3q-nodejs-20.17.0/bin/node,/nix/store/90wa8dsnqbr9fd3kybk9ir1kf82bfrqa-pm2-5.4.2/lib/node_modules/pm2/lib/Daemon.js
argv0 : node
user : benbot
uid : 1000
gid : 100
uptime : 6min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 5.4.2
node version : 20.17.0
node path : /nix/store/90wa8dsnqbr9fd3kybk9ir1kf82bfrqa-pm2-5.4.2/bin/pm2
argv : /nix/store/w78sh036dyn14f29w8za9ni9syrmwm3q-nodejs-20.17.0/bin/node,/nix/store/90wa8dsnqbr9fd3kybk9ir1kf82bfrqa-pm2-5.4.2/lib/node_modules/pm2/bin/pm2,report
argv0 : /nix/store/w78sh036dyn14f29w8za9ni9syrmwm3q-nodejs-20.17.0/bin/node
user : benbot
uid : 1000
gid : 100
===============================================================================
--- System info --------------------------------------------
arch : x64
platform : linux
type : Linux
cpus : AMD Ryzen 9 7900X 12-Core Processor
cpus nb : 24
freemem : 122684841984
totalmem : 134159986688
home : /home/benbot
===============================================================================
--- PM2 list -----------------------------------------------
┌────┬──────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├────┼──────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ shell │ default │ N/A │ fork │ 72652 │ 5m │ 0 │ online │ 0% │ 57.4mb │ benbot │ disabled │
│ 1 │ shell │ default │ N/A │ fork │ 72653 │ 5m │ 0 │ online │ 0.1% │ 57.3mb │ benbot │ disabled │
│ 2 │ shell │ default │ N/A │ fork │ 72663 │ 5m │ 0 │ online │ 0% │ 56.9mb │ benbot │ disabled │
│ 3 │ shell │ default │ N/A │ fork │ 72673 │ 5m │ 0 │ online │ 0.1% │ 57.4mb │ benbot │ disabled │
│ 4 │ shell │ default │ N/A │ fork │ 72693 │ 5m │ 0 │ online │ 0.1% │ 57.8mb │ benbot │ disabled │
│ 5 │ shell │ default │ N/A │ fork │ 72694 │ 5m │ 0 │ online │ 0.1% │ 57.5mb │ benbot │ disabled │
│ 6 │ shell │ default │ N/A │ fork │ 72705 │ 5m │ 0 │ online │ 0.1% │ 56.8mb │ benbot │ disabled │
└────┴──────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/benbot/.pm2/pm2.log last 20 lines:
PM2 | 2024-10-15T11:34:44: PM2 log: Application log path : /home/benbot/.pm2/logs
PM2 | 2024-10-15T11:34:44: PM2 log: Worker Interval : 30000
PM2 | 2024-10-15T11:34:44: PM2 log: Process dump file : /home/benbot/.pm2/dump.pm2
PM2 | 2024-10-15T11:34:44: PM2 log: Concurrent actions : 2
PM2 | 2024-10-15T11:34:44: PM2 log: SIGTERM timeout : 1600
PM2 | 2024-10-15T11:34:44: PM2 log: ===============================================================================
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:0] starting in -fork mode-
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:1] starting in -fork mode-
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:0] online
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:1] online
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:2] starting in -fork mode-
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:2] online
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:3] starting in -fork mode-
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:3] online
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:4] starting in -fork mode-
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:4] online
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:5] starting in -fork mode-
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:5] online
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:6] starting in -fork mode-
PM2 | 2024-10-15T11:36:25: PM2 log: App [shell:6] online