diff --git a/app.js b/app.js index 8ed093631e..c0822a6edc 100644 --- a/app.js +++ b/app.js @@ -143,14 +143,10 @@ function start() { plugins.ready(function() { webserver.init(function() { - // If this callback is called, this means that loader.js is used - process.on('message', function(msg) { - if (msg === 'bind') { - webserver.listen(); - } - }); - process.send({ - action: 'ready' + webserver.listen(function() { + process.send({ + action: 'ready' + }); }); }); }); diff --git a/loader.js b/loader.js index 0119f10f60..449d7e084f 100644 --- a/loader.js +++ b/loader.js @@ -28,6 +28,7 @@ Loader.init = function() { exec: "app.js", silent: silent }); + Loader.primaryWorker = 1; if (silent) { console.log = function(value) { @@ -56,8 +57,6 @@ Loader.init = function() { }); } - worker.send('bind'); - // Kill an instance in the shutdown queue var workerToKill = Loader.shutdown_queue.pop(); if (workerToKill) { @@ -162,9 +161,8 @@ Loader.init = function() { }; Loader.start = function() { - var worker; - - Loader.primaryWorker = 1; + var output = logrotate({ file: __dirname + '/logs/output.log', size: '1m', keep: 3, compress: true }), + worker; for(var x=0;x