Skip to content

Commit

Permalink
chore: merge master in development
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed May 26, 2018
2 parents 2c8170c + 31e536b commit 0e4453d
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .changelogrc
Original file line number Diff line number Diff line change
Expand Up @@ -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" : "2.10.4",
"tag": "2.10.3",
"file": "currentTagChangelog.md",
"template": "changelogTemplate.md",
"sections": [
Expand Down
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<!--
Your issue may already be reported!
Please search on the [issue tracker](https://github.com/Unitech/pm2/search?type=Issues) before creating one.
-->

## What's going wrong?

## How could we reproduce this issue?

## Supporting information

<!--
Please run the following command (available on PM2 >= 2.6)

-->
```
$ pm2 report
```
6 changes: 4 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!--
Please always submit pull requests on the development branch.

-->
| Q | A
| ------------- | ---
| Bug fix? | yes/no
Expand All @@ -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

<!--
*Please update this template with something that matches your PR*
-->
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
## 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) )


### 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) )


Expand All @@ -15,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) )
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Your app is now daemonized, monitored and kept alive forever.
### 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/).
There is also an [officialy supported Docker image](https://hub.docker.com/r/keymetrics/pm2/).

Using it is seamless:

Expand Down
23 changes: 16 additions & 7 deletions lib/API/Startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,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':
Expand Down Expand Up @@ -315,10 +324,10 @@ 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));
require('shelljs').exec(command, function(code, stdout, stderr) {
if (code === 0) {
Common.printOut(chalk.bold('[DONE] '));
Common.printOut(cst.PREFIX_MSG + chalk.bold('[v] Command successfully executed.'));
return next();
} else {
Common.printOut(chalk.red('[ERROR] Exit code : ' + code))
Expand Down
22 changes: 16 additions & 6 deletions lib/Daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,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);
Expand All @@ -282,10 +286,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() {});
});
Expand Down Expand Up @@ -313,6 +317,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() {
Expand All @@ -324,13 +333,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);
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pm2",
"preferGlobal": true,
"version": "3.0.0",
"version": "3.0.0-alpha1",
"engines": {
"node": ">=4.0.0"
},
Expand Down

0 comments on commit 0e4453d

Please sign in to comment.