From 0ff09d8093ce264744c868a28e7ee067b877e40c Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 6 May 2015 21:41:04 -0400 Subject: [PATCH] changed the behaviour of --no-daemon so that it does not also pipe output to stdout, use new flag --no-silent for that. --no-daemon just does as it advertises, and doesn't daemonize the loader process before spawning app.js instances. --- loader.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/loader.js b/loader.js index 9435b63f3a..5baf636dbf 100644 --- a/loader.js +++ b/loader.js @@ -9,11 +9,15 @@ var nconf = require('nconf'), async = require('async'), logrotate = require('logrotate-stream'), - pkg = require('./package.json'), + pkg = require('./package.json'); - pidFilePath = __dirname + '/pidfile', +nconf.argv().env().file({ + file: path.join(__dirname, '/config.json') +}); + +var pidFilePath = __dirname + '/pidfile', output = logrotate({ file: __dirname + '/logs/output.log', size: '1m', keep: 3, compress: true }), - silent = process.env.NODE_ENV !== 'development', + silent = nconf.get('silent') !== false, numProcs, workers = [], @@ -242,10 +246,6 @@ Loader.notifyWorkers = function(msg, worker_pid) { }); }; -nconf.argv().env().file({ - file: path.join(__dirname, '/config.json') -}); - fs.open(path.join(__dirname, 'config.json'), 'r', function(err) { if (!err) { if (nconf.get('daemon') !== false) {