Pm2: App disappear from pm list but is still running

Created on 11 Aug 2017  路  6Comments  路  Source: Unitech/pm2

I am trying to start a new node process with pm2 after deleted all but my old process is still running and port is currently in use. Hope you can help me with this guys. I try to kill the process but nothing works.

screen shot 2017-08-10 at 7 02 14 pm

Windows stale

Most helpful comment

What if there is no "PM2", "God Daemon" or "God". Just a bunch of "node" services but I can't kill them because I have another app running node services.
I tried "pm2 kill", "pm2 stop 0" but nothing stop the node server.

All 6 comments

Killing the app with PM2 still running won't work as PM2 will automatically restart it. You'd have to kill and restart PM2.

how I kill PM2? you mean uninstall it?

The Easy Way

PM2 when working as expected can be killed with pm2 kill. This is the best-case scenario, as it is the default way of killing the process, and ensures that any running processes being managed by PM2 can be shut down gracefully. It also means you don't need to get into any of the more complicated stuff below. If that doesn't work, read on.

_Disclaimer: This next step can cause serious problems with your machine if you kill the wrong thing. Please make sure you've got the right PID and don't just go all Rambo on your process list_

Unix-based Operating Systems:

ps aux | grep God will find you the PM2 background process, you should see something like this:

danielriosb  492261  0.3  1.1 937720 46944 ?        Ssl  Aug26  19:05 PM2 v2.4.6: God Daemon (/apps/danielriosb/.pm2)
danielriosb  863257  0.0  0.0 112648   968 pts/1    S+   15:36   0:00 grep --color=auto God

The first result here is the PM2 process, called the God Daemon. The second result is actually the grep from the command itself.

That 492261 above is the PID for the process, and if you do kill [PID] (kill 492261 in this case) the operating system will ask the process to close. If that doesn't work, and it will pretty much always work with PM2 in my experience, you can do kill -9 [PID] which will force the process to close.

Windows

tasklist will get you a list of all processes, you're looking for one called "God Daemon". You can also try playing around with tasklist /FI "IMAGENAME eq God" or something like that, but I'm less familiar with Windows. You'll get something like this:

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
System Idle Process              0 Services                   0         24 K
SynTPEnh.exe                  4152 Console                    1      8,080 K
God Daemon.exe                1740 Console                    1    857,536 K

I'm not actually sure what the process is called on windows, but it probably has something to do with either "PM2", "God Daemon" or "God". If there's any doubt, google it.

That 1740 above is the PID for the process, and if you do taskkill /pid [PID] (taskkill /pid 1740 in this case) the operating system will ask the process to close. If that doesn't work, and it will pretty much always work with PM2 in my experience, you can do taskkill /pid [PID] /f which will force the process to close.

What if there is no "PM2", "God Daemon" or "God". Just a bunch of "node" services but I can't kill them because I have another app running node services.
I tried "pm2 kill", "pm2 stop 0" but nothing stop the node server.

Try pm2 deepUpdate
that seem to find the processes it couldn't find before.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shaunwarman picture shaunwarman  路  3Comments

rangercyh picture rangercyh  路  4Comments

ldarren picture ldarren  路  3Comments

rajendar38 picture rajendar38  路  3Comments

liujb picture liujb  路  3Comments