Is it possible to stop or disable a pm2 module ? I did install the pm2-logrotate module but recently the community found an issue which is affecting our services and we need to stop or disable the module in top priority.
The module is continuously restarting and the node application in is production. So we cannot just stop the pm2 and look for a fix.
nodejs version: "4.8.2"
pm2 version "2.7.2"
pm2-logrotate version "2.4.0"
OS-Release: "Raspbian Stretch"
$ pm2 describe pm2-logrotate | grep -i script
│ script path │ /home/user/.pm2/node_modules/pm2-logrotate/app.js │
│ script args │ N/A │
│ script id │ 0 │
$ pm2 describe pm2-logrotate | grep -i id
Describing process with id 0 - name pm2-logrotate
│ pid path │ /home/user/.pm2/pids/pm2-logrotate-0.pid │
│ script id │ 0 │
$ cat /home/user/.pm2/pids/pm2-logrotate-0.pid
7723
How to disable monitoring for a specific process? You can then use the command `pm2 unmonitor [APP_NAME|ID]` to stop monitoring a process with PM2 Plus. `pm2 ls` will display a red dot indicating the application will not be monitored by PM2 Plus. If you want to monitor the process again use `pm2 monitor [APP_NAME|ID]`.
Installation. pm2 install <module-name> # Install a module from GitHub (username/repository) pm2 install pm2-hive/pm2-docker # Install a module in dev mode from local folder pm2 install .
Restart on file change To totally disable the watch feature, do: pm2 stop app --watch or toggle the watch option on application restart via pm2 restart app --watch .
You can do pm2 describe pm2-logrotate
. This will return alot of information. What you are looking for is script id
│ interpreter │ node
│ interpreter args │ N/A
│ script id │ 0
│ exec cwd │ /home/user/.pm2/modules/pm2-logrotate/node_modules/pm2-logrotate
│ exec mode │ fork_mode
│ node.js version │ 8.11.1
Now you know that the AppId
is 0 so you can do
pm2 stop 0
and the module will stop.
You can always uninstall using
pm2 uninstall pm2-logrotate
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