afbobak / nopar

Node PAckage Registry
http://afbobak.github.io/nopar/
Other
42 stars 13 forks source link

nopar fails to restart after changing hostname and/or port #13

Open jakef opened 10 years ago

jakef commented 10 years ago

Howdy,

I am attempting to set up a nopar registry on a remote server. I can install successfully with the npm install -g nopar command, and when I run nopar the server starts up properly. When I change the hostname and/or the port number in the setting, nopar displays Hostname/port changed. You probably have to restart NOPAR.

However, when I exit using ctrl+c and run nopar again, nopar fails to start, and I receive the following error:

root@test:~# nopar
info: Registry Path: /usr/local/lib/node_modules/nopar/registry

events.js:72
        throw er; // Unhandled 'error' event
                 ^
Error: listen EADDRNOTAVAIL
    at errnoException (net.js:901:11)
    at Server._listen2 (net.js:1020:19)
    at listen (net.js:1061:10)
    at net.js:1135:9
    at asyncCallback (dns.js:68:16)
    at Object.onanswer [as oncomplete] (dns.js:121:9)

About my system:

afbobak commented 10 years ago

Hi -- the reason is the start/stop script failed to kill the nopar server and you still have an old version running. You have to look for the service and kill it manually. The process should show up as node ./lib/server.js or something similar if you do a ps axuwww | grep node. Then do a kill -9 <pid>, replacing <pid> with the PID of the previously mentioned process.