Active
Project:
Node.js integration
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2012 at 17:39 UTC
Updated:
22 Feb 2012 at 02:46 UTC
Jump to comment: Most recent
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
Comment #1
Anonymous (not verified) commentedmeh. 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.