diff --git a/bin/haraka b/bin/haraka index a96b8d4be..1e59e8a4d 100755 --- a/bin/haraka +++ b/bin/haraka @@ -294,26 +294,7 @@ else if (parsed.configs) { process.argv[1] = path.join(__dirname, '../haraka.js'); process.env.HARAKA = parsed.configs; - require.paths.unshift(path.join(process.env.HARAKA, 'node_modules')); - - var logger = require(path.join(base, 'logger')) - server = require(path.join(base, 'server')); - - process.on('uncaughtException', function (err) { - if (err.stack) { - err.stack.split("\n").forEach(logger.logcrit); - } - else { - logger.logcrit('Caught exception: ' + err); - } - if (!server.ready) { - logger.logcrit('Server not ready yet. Stopping.'); - process.exit(); - } - }); - - logger.log("Starting up Haraka version " + ver); - server.createServer(); + require(path.join(base, 'haraka.js')); } else if (parsed.install) { diff --git a/haraka.js b/haraka.js index c0b12178b..a92cab383 100644 --- a/haraka.js +++ b/haraka.js @@ -7,7 +7,9 @@ var fs = require('fs'); var logger = require('./logger'); var server = require('./server'); -exports.version = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version; +exports.version = JSON.parse( + fs.readFileSync(path.join(__dirname, './package.json'), 'utf8') + ).version; process.on('uncaughtException', function (err) { if (err.stack) {