pm2 stop causes watching to stop working
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:
- Start the app with
pm2 start ecosystem.js
- ecosystem.js file has
watch: trueenabled pm2 listalso showing watching enabled- It works like charm until
pm2 stopcommand is used. - after using
pm2 stopandpm2 startthe process id, it does not works as expected andpm2 liststill 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:
pm2 restartinstead ofpm2 stopandpm2 start- or
pm2 deletethe process andpm2 startagain - or
pm2 killandpm2 startagain
happened to me now
+1