From 1028b3cc9cffe5b2f8983078fd3995246d040e66 Mon Sep 17 00:00:00 2001 From: vince Date: Fri, 27 Apr 2018 11:52:03 +0200 Subject: [PATCH 1/8] chore: upgrade version to 2.10.3 and update changelog --- .changelogrc | 4 ++-- CHANGELOG.md | 7 +++++++ package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.changelogrc b/.changelogrc index 2d0e491e..6da07892 100644 --- a/.changelogrc +++ b/.changelogrc @@ -4,8 +4,8 @@ "intro": "", "branch" : "master", "repo_url": "https://github.com/Unitech/pm2", - "version_name" : "v2.10.2", - "tag": "2.10.1", + "version_name" : "v2.10.3", + "tag": "2.10.2", "file": "currentTagChangelog.md", "template": "changelogTemplate.md", "sections": [ diff --git a/CHANGELOG.md b/CHANGELOG.md index bdfaa39c..9f962b85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## v2.10.3 ( Fri Apr 27 2018 11:42:16 GMT+0200 (CEST) ) + + +### Chore + - upgrade for node 10 + ([cf7630e](https://github.com/Unitech/pm2/commit/cf7630e259742bdff8257cff4dbed2732bf24f9c)) + ## v2.10.2 ( Thu Mar 29 2018 13:06:11 GMT+0200 (CEST) ) diff --git a/package.json b/package.json index 2f11edf0..e3cbb075 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pm2", "preferGlobal": true, - "version": "2.10.2", + "version": "2.10.3", "engines": { "node": ">=0.12" }, From 55d25ffbe9c5688a370d685d35b286ae32a301ed Mon Sep 17 00:00:00 2001 From: Unitech Date: Fri, 27 Apr 2018 11:56:06 +0200 Subject: [PATCH 2/8] docs: README changes --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 1ef3279a..020e11ce 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,21 @@ Your app is now daemonized, monitored and kept alive forever. [More about Process Management](http://pm2.keymetrics.io/docs/usage/process-management/) +### Container Support + +With the drop-in replacement command for `node`, called `pm2-runtime`, run your Node.js application in a proper production environment. +There is also an [officialy supported Docker image](https://hub.docker.com/r/keymetrics/pm2/). + +Using it is seamless: + +``` +FROM keymetrics/pm2:latest-alpine +[...] +CMD [ "pm2-runtime", "npm", "--", "start" ] +``` + +[Read More about the dedicated integration](http://pm2.keymetrics.io/docs/usage/docker-pm2-nodejs/) + ### Managing a Process Once applications are started you can manage them easily: @@ -130,21 +145,6 @@ Seamlessly supported by all major Node.js frameworks and any Node.js application [More informations about how PM2 make clustering easy](https://keymetrics.io/2015/03/26/pm2-clustering-made-easy/) -### Container Support - -With the drop-in replacement command for `node`, called `pm2-runtime`, run your Node.js application in a proper production environment. -We also offer an [officialy supported Docker image](https://hub.docker.com/r/keymetrics/pm2/). - -Using it is seamless: - -``` -FROM keymetrics/pm2:latest-alpine -[...] -CMD [ "pm2-runtime", "npm", "--", "start" ] -``` - -[Read More about the dedicated integration](http://pm2.keymetrics.io/docs/usage/docker-pm2-nodejs/) - ### Terminal Based Monitoring ![Monit](https://github.com/Unitech/pm2/raw/master/pres/pm2-monit.png) From d529f675d0240777cba95442ba35205c370cdb43 Mon Sep 17 00:00:00 2001 From: Unitech Date: Thu, 10 May 2018 19:10:47 +0200 Subject: [PATCH 3/8] fix: #3645 throttle startup --- lib/API/Startup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/API/Startup.js b/lib/API/Startup.js index 5249acc5..f1b7cbe6 100644 --- a/lib/API/Startup.js +++ b/lib/API/Startup.js @@ -320,7 +320,7 @@ module.exports = function(CLI) { shelljs.exec(command, function(code, stdout, stderr) { if (code === 0) { Common.printOut(chalk.bold('[DONE] ')); - return next(); + return setTimeout(function() { next() }, 500); } else { Common.printOut(chalk.red('[ERROR] Exit code : ' + code)) return next(new Error(command + ' failed, see error above.')); From 9e0180eddab071916144ad7008817bd6aef1c8ce Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Sat, 12 May 2018 17:33:08 +0200 Subject: [PATCH 4/8] chore: update issue and PR templates to use comments to hide instructions in the frontend --- .github/ISSUE_TEMPLATE.md | 5 ++++- .github/PULL_REQUEST_TEMPLATE.md | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index b6ddb7c1..113fee12 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,7 @@ + ## What's going wrong? @@ -7,8 +9,9 @@ Please search on the [issue tracker](https://github.com/Unitech/pm2/search?type= ## Supporting information + ``` $ pm2 report ``` diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c94ce3c9..9896e87f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,6 @@ + | Q | A | ------------- | --- | Bug fix? | yes/no @@ -10,5 +11,6 @@ Please always submit pull requests on the development branch. | Fixed tickets | #1234, #5678 | License | MIT | Doc PR | https://github.com/pm2-hive/pm2-hive.github.io/pulls - + \ No newline at end of file From 1d0c76dd95287702fc2df304304b64bd25af4911 Mon Sep 17 00:00:00 2001 From: Unitech Date: Thu, 17 May 2018 14:33:20 +0200 Subject: [PATCH 5/8] pm2@2.10.4 --- .changelogrc | 4 ++-- CHANGELOG.md | 24 +++++++++++++++++++++++- package.json | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.changelogrc b/.changelogrc index 6da07892..14a1a689 100644 --- a/.changelogrc +++ b/.changelogrc @@ -4,8 +4,8 @@ "intro": "", "branch" : "master", "repo_url": "https://github.com/Unitech/pm2", - "version_name" : "v2.10.3", - "tag": "2.10.2", + "version_name" : "2.10.4", + "tag": "2.10.3", "file": "currentTagChangelog.md", "template": "changelogTemplate.md", "sections": [ diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f962b85..fbd96fd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +## 2.10.4 ( Thu May 17 2018 14:32:40 GMT+0200 (CEST) ) + + +## Bug Fixes + - #3645 throttle startup + ([d529f675](https://github.com/Unitech/pm2/commit/d529f675d0240777cba95442ba35205c370cdb43)) + + + + +## Chore + - update issue and PR templates to use comments to hide instructions in the frontend + ([9e0180ed](https://github.com/Unitech/pm2/commit/9e0180eddab071916144ad7008817bd6aef1c8ce)) + + + + +## Pull requests merged + - Merge pull request #3664 from DanielRuf/chore/update-issue-pr-templates + ([067446f2](https://github.com/Unitech/pm2/commit/067446f2133ba7f761b0ad3c9f3692b167affd8b)) + + ## v2.10.3 ( Fri Apr 27 2018 11:42:16 GMT+0200 (CEST) ) @@ -22,7 +44,7 @@ ([438e3030](https://github.com/Unitech/pm2/commit/438e303013e82ecc199cb68d018144cde8a0b2e6)) - Merge pull request #3532 from N-Nagorny/logs-smart-app-name-cutting ([067c18e6](https://github.com/Unitech/pm2/commit/067c18e601aca4fac10101a7c23cc4c3525ad776)) - + ## v2.10.1 ( Mon Feb 26 2018 11:38:18 GMT+0100 (CET) ) diff --git a/package.json b/package.json index e3cbb075..0a27c968 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pm2", "preferGlobal": true, - "version": "2.10.3", + "version": "2.10.4", "engines": { "node": ">=0.12" }, From f8a6a634623808625c9a0861553307268878944a Mon Sep 17 00:00:00 2001 From: Unitech Date: Thu, 17 May 2018 17:09:45 +0200 Subject: [PATCH 6/8] fix: fix systemd command for ubuntu 18 #3645 --- lib/API/Startup.js | 25 +++++++++++++++++-------- lib/Daemon.js | 22 ++++++++++++++++------ 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/lib/API/Startup.js b/lib/API/Startup.js index f1b7cbe6..7810dc82 100644 --- a/lib/API/Startup.js +++ b/lib/API/Startup.js @@ -222,12 +222,21 @@ module.exports = function(CLI) { else template = getTemplate('systemd'); destination = '/etc/systemd/system/' + service_name + '.service'; + commands = [ - 'systemctl enable ' + service_name, - 'systemctl start ' + service_name, - 'systemctl daemon-reload', - 'systemctl status ' + service_name - ]; + 'systemctl enable ' + service_name + ] + + try { + fs.readFileSync(cst.PM2_PID_FILE_PATH).toString() + } catch(e) { + commands = [ + 'systemctl enable ' + service_name, + 'systemctl start ' + service_name, + 'systemctl daemon-reload', + 'systemctl status ' + service_name + ] + } break; case 'ubuntu14': case 'ubuntu12': @@ -316,11 +325,11 @@ module.exports = function(CLI) { Common.printOut(cst.PREFIX_MSG + 'Making script booting at startup...'); async.forEachLimit(commands, 1, function(command, next) { - Common.printOut(chalk.bold('>>> Executing %s'), command); + Common.printOut(cst.PREFIX_MSG + '[-] Executing: %s...', chalk.bold(command)); shelljs.exec(command, function(code, stdout, stderr) { if (code === 0) { - Common.printOut(chalk.bold('[DONE] ')); - return setTimeout(function() { next() }, 500); + Common.printOut(cst.PREFIX_MSG + chalk.bold('[v] Command successfully executed.')); + return next(); } else { Common.printOut(chalk.red('[ERROR] Exit code : ' + code)) return next(new Error(command + ' failed, see error above.')); diff --git a/lib/Daemon.js b/lib/Daemon.js index 26c9c98e..22f5fc7d 100644 --- a/lib/Daemon.js +++ b/lib/Daemon.js @@ -272,6 +272,10 @@ Daemon.prototype.close = function(opts, cb) { } } + try { + fs.unlinkSync(that.pid_path); + } catch(e) {} + console.log('PM2 successfully stopped'); setTimeout(function() { process.exit(cst.SUCCESS_EXIT); @@ -283,10 +287,10 @@ Daemon.prototype.close = function(opts, cb) { Daemon.prototype.handleSignals = function() { var that = this; - process.on('SIGTERM', that.gracefullExit); - process.on('SIGINT', that.gracefullExit); + process.on('SIGTERM', that.gracefullExit.bind(this)); + process.on('SIGINT', that.gracefullExit.bind(this)); process.on('SIGHUP', function() {}); - process.on('SIGQUIT', that.gracefullExit); + process.on('SIGQUIT', that.gracefullExit.bind(this)); process.on('SIGUSR2', function() { God.reloadLogs({}, function() {}); }); @@ -314,6 +318,11 @@ Daemon.prototype.sendReady = function(cb) { Daemon.prototype.gracefullExit = function() { var that = this; + God.bus.emit('pm2:kill', { + status : 'killed', + msg : 'pm2 has been killed by SIGNAL' + }); + console.log('pm2 has been killed by signal, dumping process list before exit...'); God.dumpProcessList(function() { @@ -325,13 +334,14 @@ Daemon.prototype.gracefullExit = function() { God.deleteProcessId(proc.pm2_env.pm_id, function() { return next(); }); - return false; }, function(err) { try { fs.unlinkSync(that.pid_path); } catch(e) {} - console.log('Exited peacefully'); - process.exit(0); + setTimeout(function() { + console.log('Exited peacefully'); + process.exit(cst.SUCCESS_EXIT); + }, 2); }); }); } From a6b04bff7fdc0756af272557af209775cb9e9e4d Mon Sep 17 00:00:00 2001 From: Unitech Date: Thu, 17 May 2018 17:30:29 +0200 Subject: [PATCH 7/8] chore: pm2@2.10.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a27c968..ba59f472 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pm2", "preferGlobal": true, - "version": "2.10.4", + "version": "2.10.5", "engines": { "node": ">=0.12" }, From 31e536b5d96b11a259c82ac9bfc8022bfbafca61 Mon Sep 17 00:00:00 2001 From: Unitech Date: Thu, 17 May 2018 17:30:50 +0200 Subject: [PATCH 8/8] pm2@2.10.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ba59f472..0a27c968 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pm2", "preferGlobal": true, - "version": "2.10.5", + "version": "2.10.4", "engines": { "node": ">=0.12" },