Skip to content

Commit

Permalink
Merge pull request #1 from tastapod/master
Browse files Browse the repository at this point in the history
Pass environment through to child processes
  • Loading branch information
jiem committed Feb 2, 2012
2 parents 8daf9be + 11df055 commit 3326dc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -276,7 +276,7 @@ function _starter(self) {
self.commandLineErr || process.argv.push('--err', self.errFile);
process.argv[1] = '--monitor';
process.argv.push(startTime);
child = child_process.spawn(command, process.argv, {setsid: true});
child = child_process.spawn(command, process.argv, {env: process.env, setsid: true});
if (child) {
fs.writeFileSync(self.pidFile, child.pid + '|' + startTime);
self.emit('start', {status: 'daemonForkSuccessful', pid: child.pid});
Expand All @@ -293,7 +293,7 @@ function _monitor(self) {
var runner;

function fork() {
runner = child_process.fork(script, process.argv, {setsid: true});
runner = child_process.fork(script, process.argv, {env: process.env, setsid: true});
if (process.argv.indexOf('--logAppend') === -1)
process.argv.splice(process.argv.length - 1, 0, '--logAppend');
if (runner) {
Expand Down Expand Up @@ -375,4 +375,4 @@ function isProcessRunning(pid, callback) {
}

//==============================================================================
module.exports = startStopDaemon;
module.exports = startStopDaemon;

0 comments on commit 3326dc2

Please sign in to comment.