简体   繁体   English

nodejs:永远不响应

[英]nodejs: forever not responding

So I know, it was not the most smartass idea, but I updated nodejs to version 0.10 with "n" while the server was still running with forever. 所以我知道,这不是最聪明的想法,但是当服务器仍在运行时,我用“n”将nodejs更新为0.10版本。 Now when I try typing in 现在当我尝试输入时

$ forever list

or 要么

$ forever stopall

or 要么

$ forever restartall

it simply does nothing. 它什么都不做。 Anyways - 无论如何 -

$ forever --help

still shows the help menu, but all actions won't work. 仍显示帮助菜单,但所有操作都不起作用。 And my nodejs Server is still responding! 我的nodejs服务器仍在响应!

Is there any method I can kill forever with fire? 有什么方法可以永远用火杀死吗?

You can use 您可以使用

sudo killall node  

OR 要么

sudo forever stopall

If that too doesn't work simply use 如果这也不起作用,只需使用

sudo kill -9 $(ps aux | grep 'node' | awk '{print $2}') 

Hope this works 希望这有效

I've seen this problem in monitoring daemons in general, such as forever and hotnode. 我在监视守护进程时已经看到了这个问题,例如forever和hotnode。 As you indicated, you can grep the pids of the lost processes. 正如您所指出的,您可以查看丢失进程的pid。 I went so far as to add killall node to my production boot script, actually (a little less wordy than your solution, and a bit overkill, but it's effectively solved the problem). 我甚至将killall node添加到我的生产启动脚本中,实际上(比你的解决方案稍微冗长,有点矫枉过正,但它有效地解决了这个问题)。

Ok with a litte help i solved the problem: 好的,有点帮助我解决了问题:

Just type in 只需输入

$ ps aux | less

and search for all processes that have to do something with nodejs and kill them with 并搜索所有必须对nodejs执行某些操作的进程并使用它们将其终止

$ kill -9 *PID HERE*

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM