开发者

Node.js script running, but it won't stop!

开发者 https://www.devze.com 2023-03-16 04:21 出处:网络
I have this test.js running in Node.js under CentOS 5. It works perfectly. Problem is, it won\'t stop! Even after closing my ssh client, it won\'t stop.

I have this test.js running in Node.js under CentOS 5. It works perfectly. Problem is, it won't stop! Even after closing my ssh client, it won't stop.

How can I stop a running s开发者_运维技巧cript?


Doesn't

$ pkill node

work for you?


What is the code your running, if it's the Sample code provided by nodejs.net's front-page then when your in your terminal and your server is running, you can just hit CTRL + C to stop the current task

If you are over SSH And you wish to issue a command to stop the node processes then do something like so:

$ ps aux | grep node
USR  PID  1.5  0.2  44172  8260 pts/2    S    15:25   0:00 node app.js
$ kill -2 PID

That's just finding the PID's of the Node Processes and then killing them

0

精彩评论

暂无评论...
验证码 换一张
取 消