Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to kill the pm2 --no-daemon process

I'm using pm2 as the process manager of Node.js.

In many cases, I think I will run it as a daemon process, but if you use it locally as debugging, I think that there are times when you use the --no-daemon option.

How do I end the process when moving pm2 with this --no-daemon option?

like image 872
Junya Kono Avatar asked Jul 20 '17 02:07

Junya Kono


1 Answers

You can try:

pm2 kill

or find the running PM2 process with:

ps aux | grep PM2

then kill with:

kill -9 [pid]

The -9 switch sends the KILL signal to the process as opposed to the default interrupt (INT or SIGINT) signal and is equivalent to -KILL or -SIGKILL. Interrupt is a less invasive way and you could try that first to let the process gracefully exit, however, if it doesn't respond to that, the kill signal should result in an immediate termination (unless the process is zombie).

like image 167
marekful Avatar answered Sep 17 '22 15:09

marekful