From my linux machine, typing pm2 status
shows me
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │
├──────────────┼────┼──────┼───────┼─────────┼─────────┼────────┼─────────────┼──────────┤
│ gamatrix-dev │ 0 │ fork │ 0 │ stopped │ 0 │ 0 │ 0 B │ disabled │
│ gamatrix │ 1 │ fork │ 22779 │ online │ 10 │ 2D │ 78.793 MB │ disabled │
│ elevacad │ 2 │ fork │ 14106 │ online │ 13 │ 3D │ 36.227 MB │ disabled │
I'm pretty sure for the last two lines, they were initiated by a command like pm2 start someapp.js
. Is there a way to know what value someapp.js
really was that started the process?
As mentioned in a comment, use
pm2 describe
That will produce copious output similar to the following:
┌───────────────────┬─────────────────────────────────────────────────────────────────────────────────────┐
│ status │ online │
│ name │ random │
│ namespace │ default │
│ version │ 1.0.0 │
│ restarts │ 0 │
│ uptime │ 107m │
│ script path │ /home/pi/checkout/random-monitor.ts │
│ script args │ N/A │
│ error log path │ /home/pi/.pm2/logs/random-error.log │
│ out log path │ /home/pi/.pm2/logs/random-out.log │
│ pid path │ /home/pi/.pm2/pids/random-1.pid │
│ interpreter │ /home/pi/.nvm/versions/node/v12.19.0/lib/node_modules/pm2/node_modules/.bin/ts-node │
│ interpreter args │ N/A │
│ script id │ 1 │
│ exec cwd │ /home/pi/checkout │
│ exec mode │ fork_mode │
│ node.js version │ 12.19.0 │
│ node env │ N/A │
│ watch & reload │ ✘ │
│ unstable restarts │ 0 │
│ created at │ 2020-11-18T00:17:04.623Z │
└───────────────────┴─────────────────────────────────────────────────────────────────────────────────────┘
The interpreter
, interpreter args
, script path
and script args
should give you what you are after. See also this answer to a similar question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With