Question

I inherited a server and I'm having an odd issue. I was having a problem when running forever start server.js in which it didn't return a message, and then forever list didn't show any forever processes running. After some digging I found that some people suggested running forever as sudo.

After I ran sudo forever start server.js it seemed to fire up just fine, and forever list shows server.js as running. However, now I cannot stop the process. Running kill removes node from the list displayed at top, but Forever still views server.js as running. Running sudo forever stop server.js returns the error "server.js is not a valid index for a forever process." Running sudo forever stopall or sudo forever list returns

node.js:63
    throw e;
    ^
TypeError: Cannot call method 'replace' of undefined
    at Argv (/usr/local/lib/node/.npm/optimist/0.1.2/package/lib/optimist.js:38:33)
    at Object.<anonymous> (/usr/local/lib/node/.npm/forever/0.3.0/package/bin/forever:81:26)
    at Module._compile (node.js:462:23)
    at Module._loadScriptSync (node.js:469:10)
    at Module.loadSync (node.js:338:12)
    at loadModule (node.js:283:14)
    at require (node.js:411:14)
    at Object.<anonymous> (/usr/local/bin/forever:11:18)
    at Module._compile (node.js:462:23)
    at Module._loadScriptSync (node.js:469:10)

No matter what I do, I can't stop server.js. I guess forever is being a little overzealous in it's mission. Any suggestions?

Was it helpful?

Solution

No idea why this worked, but for some reason it solved my problem. Well not entirely, but partially. When I su root and then run the forever commands, I am able to start and stopall without a hitch. Still getting the same error for forever stop server.js, so for whatever reason I'm unable to stop the server that way, but I got around it by being able to run forever stopall as su root.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top