diff --git a/lib/forever/service/cli.js b/lib/forever/service/cli.js index ef23328f..674e15b4 100644 --- a/lib/forever/service/cli.js +++ b/lib/forever/service/cli.js @@ -73,6 +73,15 @@ app.cmd('restart', cli.restart = function () { app.cmd('list', cli.list = function () { service.list(function (err, applications) { + if (err) { + app.log.error('Error running command: ' + 'list'.magenta); + app.log.error(err.message); + err.stack && err.stack.split('\n').forEach(function (line) { + app.log.error(line); + }) + return; + } + applications.forEach(function printApplication(application) { console.log(application.monitor.uid, application.monitor.command, application.file, application.monitor.child.pid, application.monitor.logFile, application.monitor.pidFile); }); @@ -88,6 +97,6 @@ app.cmd('resume', cli.resume = function () { }); cli.startCLI = function () { - app.init(app.start); + app.start(); }; diff --git a/lib/forever/service/service.js b/lib/forever/service/service.js index c17d13f8..74a3e005 100644 --- a/lib/forever/service/service.js +++ b/lib/forever/service/service.js @@ -39,7 +39,6 @@ var Service = module.exports = function Service(options) { AdapterType = options.adapter || SystemVAdapter; this.adapter = new AdapterType(this); - console.log(this.adapter); }; util.inherits(Service, events.EventEmitter); @@ -50,11 +49,9 @@ Service.prototype.startServer = function startServer(callback) { self = this, server; - console.log('SS'); server = dnode(this); portfinder.getSocket({ path: socket }, function onSocketFound(err, socket) { - console.error(arguments); if (err) { return callback(err); } @@ -89,17 +86,12 @@ Service.prototype.listen = function listen(server) { this.servers.push(dnodeServer); dnodeServer.listen(server); - setTimeout(function () { - console.error(dnodeServer); - }, 10000); - return this; }; Service.prototype.load = function load() { var self = this; this.adapter.load(function onLoaded(applications) { - console.error(arguments); applications.forEach(function startApplication(application, index) { var monitor = application.monitor = new forever.Monitor(application.file, application.options); @@ -123,7 +115,6 @@ Service.prototype.load = function load() { // call's the service manager's add method // Service.prototype.add = function add(file, options, callback) { - console.log(arguments); if (this.paused) { return callback && callback(new Error('foreverd is paused')); } @@ -211,9 +202,7 @@ Service.prototype.start = function start(callback) { Service.prototype.run = function run(callback) { var self = this; this.adapter.run(function adapterStarted() { - console.error(self.applications); self.applications.forEach(function startApplication(application) { - console.error(application); application.monitor = new forever.Monitor(application.file, application.options); application.monitor.start(); });