pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

pm2 stop causes watching to stop working

Open shseah601 opened this issue 3 years ago • 4 comments

What's going wrong?

after pm2 stop and pm2 start command, the watching feature not working at all even pm2 list showing it is enabled. The only similar issue is found in https://github.com/Unitech/pm2/issues/4434 but no one answering and the bot just closed it.

How could we reproduce this issue?

Reproduction Step:

  1. Start the app with
pm2 start ecosystem.js
  1. ecosystem.js file has watch: true enabled
  2. pm2 list also showing watching enabled
  3. It works like charm until pm2 stop command is used.
  4. after using pm2 stop and pm2 start the process id, it does not works as expected and pm2 list still showing watching enabled.

Expected Behavior

pm2 stop and pm2 start the process, user save anything in any watching directory will trigger file change and restart the process.

Supporting information

$ pm2 report

--- Daemon ----------------------------------------------- pm2d version : 5.2.2 node version : 16.16.0 --- CLI ---------------------------------------------------- local pm2 : 5.2.2 node version : 16.16.0 --- System info -------------------------------------------- arch : x64 platform : darwin type : Darwin

The only workaround to restart and remain watching are:

  1. pm2 restart instead of pm2 stop and pm2 start
  2. or pm2 delete the process and pm2 start again
  3. or pm2 kill and pm2 start again

shseah601 avatar Nov 22 '22 08:11 shseah601

happened to me now

ohadcn avatar Jan 20 '23 11:01 ohadcn

+1

Juan-2104 avatar Apr 02 '24 18:04 Juan-2104