7

When we are running multiple node services in a single machine, its becoming hard to restart one service with id as id is a sequence number allocated in order by PM2. So instead using the id is it possible to restart the process using process name?

I start my services with the service name using following command:

pm2 start index.js --name my-service-name

I want to restart them using the name 'my-service-name' so that I can automate it using a script.

Yury Fedorov
  • 14,508
  • 6
  • 50
  • 66
karthikdivi
  • 3,466
  • 5
  • 27
  • 46

1 Answers1

9

From the documentation:

pm2 start web.js --name "web-interface"
pm2 restart web-interface
Yury Fedorov
  • 14,508
  • 6
  • 50
  • 66
  • Thank you, I was referring their Quick Start page http://pm2.keymetrics.io/docs/usage/quick-start/#cheat-sheet and this information is missing there. – karthikdivi Sep 10 '17 at 09:51