tags:

views:

136

answers:

1

I've installed and is running a node.js server on osx. I've dled a chat module and is happily running it. I've altered some pieces and need to restart the server to see the effects.

I only know how to restart by closing the terminal window and then reopneing it and then running node chatdemo.js again.

Any way to restart without closing terminal?

Thanks.

+2  A: 

If it's just running (not a daemon) then just use Ctrl-C.

If it's daemonized then you could try:

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

Where PID is replaced by the number in the output of ps.

thenduks
You could also use "killall -2 node", which has the same effect.
Pumbaa80
Don't want/need to kill _all_ node processes. If I have some node repl's open I'll be an unhappy camper after that line :)
thenduks
Drew LeSueur