I cannot find any command and it's disturbing and unclean to have it on the user sudo, for example, just because we miss sometimes and pm2 list on a different user.
I tried to kill the process, but as the daemon that it is, it auto respawn automatically.
@edravis Have you tried pm2 kill or are you looking for something different which I misunderstood?
Have you linked PM2 to Keymetrics?
If a PM2 is linked to Keymetrics and you need to kill PM2 by hand, please do a pm2 link stop first
Else the Keymetrics Watchdog will restart PM2 as long as it is not alive
Ooops! Looks like I didn't explain myself well.
We've got multiple users in our machines. But only one of them should run pm2.
Sometimes, we run some command like pm2 list as any users that shouldn't start pm2 never. Therefore, pm2 starts the pm2 God Daemon. And I'm guessing how to stop this Daemon.
For example, giving the following ps aux | grep PM2 output:
noRunPm2 15595 1.6 0.4 902060 33400 ? Ssl 17:46 0:00 PM2 v0.15.10: God Daemon
runPm2 18545 0.5 0.4 938220 31288 ? Ssl Nov23 124:18 PM2 v0.15.10: God Daemon
I would love to kill the process with the PID 15595. But when I run commands like: kill -9 15595 it respawn again and again.
So, how do I stop forever the pm2 god daemon?
P.S: Thanks for the time and sorry for the late follow up
run pm2 unstartup and that will give you a command which you run to disable setup and then reboot your machine.
If you call 'pm2 --help', you should find 'pm2 kill' in there.
Most helpful comment
If you call 'pm2 --help', you should find 'pm2 kill' in there.