From a4e9999f14a1eb4beba7f7e17eadc1e5cf50bc4d Mon Sep 17 00:00:00 2001 From: Unitech Date: Mon, 17 Nov 2014 00:12:23 +0100 Subject: [PATCH] small fixes --- constants.js | 13 ++++++++----- doc/CHANGELOG.md | 7 +++++-- lib/God.js | 2 ++ lib/samples/sample-conf.js | 1 + 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/constants.js b/constants.js index ec5da7ed..534611cd 100644 --- a/constants.js +++ b/constants.js @@ -1,7 +1,8 @@ -var p = require('path'); -var fs = require('fs'); -var util = require('util'); +var p = require('path'); +var fs = require('fs'); +var util = require('util'); +var debug = require('debug')('pm2:constants'); /** * Handle PM2 root folder relocation @@ -70,7 +71,7 @@ var default_conf = { GRACEFUL_TIMEOUT : parseInt(process.env.PM2_GRACEFUL_TIMEOUT) || 8000, GRACEFUL_LISTEN_TIMEOUT : parseInt(process.env.PM2_GRACEFUL_LISTEN_TIMEOUT) || 4000, - WORKER_INTERVAL : process.env.PM2_WORKER_INTERVAL || 30000, + WORKER_INTERVAL : parseInt(process.env.PM2_WORKER_INTERVAL) || 30000, DEBUG : process.env.PM2_DEBUG || false, WEB_INTERFACE : parseInt(process.env.PM2_API_PORT) || 9615, @@ -85,11 +86,12 @@ var default_conf = { * Extend with optional configuration file */ if (fs.existsSync(csts.PM2_CONF_FILE)) { + console.log('exists'); try { var extra = require(csts.PM2_CONF_FILE)(PM2_ROOT_PATH); default_conf = util._extend(default_conf, extra); } catch(e) { - //console.error(e.stack || e); + debug(e.stack || e); } } @@ -101,6 +103,7 @@ var conf = util._extend(default_conf, csts); if (process.platform === 'win32' || process.platform === 'win64') { + debug('Windows detected'); conf.DAEMON_RPC_PORT = '\\\\.\\pipe\\rpc.sock'; conf.DAEMON_PUB_PORT = '\\\\.\\pipe\\pub.sock'; conf.INTERACTOR_RPC_PORT = '\\\\.\\pipe\\interactor.sock'; diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 4a78e4ee..c16490c5 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,12 +1,15 @@ # 0.12.1 -- Fix Worker bug - Harden Lock system -- Add backward compatibility for older PM2 on kill action +- Fix Worker bug / Refactor Worker +- Cleanly close interactor sockets on end +- Add backward compatibility for older PM2 on kill action via system signal SIGQUIT +- once listener for killDaemon # 0.12.0 - clear water ops +- better ecosystem.json5 file with embedded comments - startOrRestart conf.json update environment variables #805 #812 - pm2 start my/bin/file work out of the box - JSON5 support diff --git a/lib/God.js b/lib/God.js index 57c6e721..038911c1 100644 --- a/lib/God.js +++ b/lib/God.js @@ -10,7 +10,9 @@ var Common = require('./Common'); var cst = require('../constants.js'); var pidusage = require('pidusage'); var vizion = require('vizion'); +var debug = require('debug')('pm2:god'); +// Memory leak inspector // require('webkit-devtools-agent').start({ // port: 9999, // bind_to: '0.0.0.0', diff --git a/lib/samples/sample-conf.js b/lib/samples/sample-conf.js index 6d57e476..92e20992 100644 --- a/lib/samples/sample-conf.js +++ b/lib/samples/sample-conf.js @@ -27,6 +27,7 @@ module.exports = function(DEFAULT_HOME) { GRACEFUL_TIMEOUT : parseInt(process.env.PM2_GRACEFUL_TIMEOUT) || 8000, GRACEFUL_LISTEN_TIMEOUT : parseInt(process.env.PM2_GRACEFUL_LISTEN_TIMEOUT) || 4000, + WORKER_INTERVAL : parseInt(process.env.PM2_WORKER_INTERVAL) || 30000, DEBUG : process.env.PM2_DEBUG || false, WEB_INTERFACE : parseInt(process.env.PM2_API_PORT) || 9615,