From 11df0555094732ba2fd6933c65b83755d02c6fd8 Mon Sep 17 00:00:00 2001 From: Dan North Date: Thu, 2 Feb 2012 16:07:56 +0000 Subject: [PATCH] [dn] Pass environment through to child process --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index d4d239f..ff968b0 100644 --- a/index.js +++ b/index.js @@ -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}); @@ -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) { @@ -375,4 +375,4 @@ function isProcessRunning(pid, callback) { } //============================================================================== -module.exports = startStopDaemon; \ No newline at end of file +module.exports = startStopDaemon;