Hi,

The way that server.js currently loads the nodejs.config.js settings uses process.cwd(). process.cwd() refers to the directory in which server.js was executed, not the directory in which it lives. Effectively that means that server.js can never be run from outside of /path/to/nodejs-module so it can't be daemonized. I would suggest changing this to:
var settings = vm.runInThisContext(fs.readFileSync(__dirname + '/nodejs.config.js'));
so that the config settings always load successfully.

Thanks.

Comments

Anonymous’s picture

meh. the main problem with that is if you want to run many server.js processes it requires multiple copies of server.js in multiple directories.

the config stuff is pretty ghetto in general. i'd rather make it suck less in a more invasive-change way than going back to using dirname, which is what the code used to do.