How to kill Respawning Node

梦想与她 提交于 2019-12-25 03:39:27

问题


Need help for killing process node JS. I'm trying to stop node js process on my server, I've been use

killall -9 node

and here is the response

node(30332): Operation not permitted
node: no process found

So I used

sudo killall -9 node

but the node js is still respawning with different PID. Any help?


回答1:


Finally found the problems, there are Parents ID that related to Node Process.

I'm using

ps -ef | grep no

and found the Parent Process ID / Sleep Process and kill the parents and then kill the node process.




回答2:


You can use process.kill() or process.exit() to kill/stop node process internally when there is stop request.

To stop all node process from command line use pkill node(in linux).



来源:https://stackoverflow.com/questions/33382188/how-to-kill-respawning-node

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!