Comparing version 0.4.6 to 0.4.7
@@ -9,3 +9,3 @@ | ||
UX.dispAsTable = function(list) { | ||
var table = new Table({ head: ["Script", "id", "PID","status", "Restarted", "memory", "err logs"] }); | ||
var table = new Table({ head: ["Script", "id", "PID","status", "Restarted", "Last restart", "memory", "err logs"] }); | ||
list.forEach(function(l) { | ||
@@ -20,4 +20,5 @@ var u = l.opts.script; | ||
l.opts.restart_time ? l.opts.restart_time : 0, | ||
l.opts.pm_uptime ? new Date(l.opts.pm_uptime).toISOString().replace(/T/, ' ').replace(/\..+/, '') : 0, | ||
l.monit ? UX.bytesToSize(l.monit.memory, 3) : '', | ||
l.opts.fileError, | ||
l.opts.fileError | ||
]; | ||
@@ -24,0 +25,0 @@ |
@@ -175,7 +175,10 @@ // pm2-monitor // Code name : God | ||
God.stopProcessId = function(id, cb) { | ||
console.log(id); | ||
if (!(id in God.clusters_db)) | ||
return cb({msg : 'Process not found'}); | ||
God.clusters_db[id].opts.max = 0; | ||
process.kill(God.clusters_db[id].process.pid); | ||
God.clusters_db[id].process.pid = 0; | ||
setTimeout(cb, 200); | ||
setTimeout(function() { | ||
cb(null, null); | ||
}, 200); | ||
}; | ||
@@ -214,2 +217,5 @@ | ||
if (env.pm_id && env.opts && env.opts.status == 'stopped') { | ||
delete God.clusters_db[env.pm_id]; | ||
} | ||
id = God.next_id; | ||
@@ -216,0 +222,0 @@ God.next_id += 1; |
@@ -27,4 +27,4 @@ | ||
HOST: hostport[0], | ||
PORT: Number(hostport[1]), | ||
} | ||
PORT: Number(hostport[1]) | ||
}; | ||
})(cst.DAEMON_BIND_ADDR); | ||
@@ -108,3 +108,6 @@ | ||
God.stopProcessId(opts.id, function(err, clu) { | ||
fn(err, stringifyOnce(clu, undefined, 0)); | ||
if (err) | ||
fn(new Error('Process not found')); | ||
else | ||
fn(err, stringifyOnce(clu, undefined, 0)); | ||
}); | ||
@@ -111,0 +114,0 @@ }, |
{ | ||
"name": "pm2", | ||
"preferGlobal": "true", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"engines" : { | ||
@@ -16,2 +16,5 @@ "node" : ">=0.8" | ||
"email" : "alex@kocharin.ru" | ||
}, { | ||
"name" : "Devo.ps", | ||
"email" : "contact@devo.ps" | ||
}], | ||
@@ -22,3 +25,3 @@ "homepage" : "http://unitech.io/", | ||
"scripts": { | ||
"test": "bash ./test/cli.sh ; NODE_ENV=test ./node_modules/mocha/bin/mocha test", | ||
"test": "bash ./test/cli.sh && NODE_ENV=test ./node_modules/mocha/bin/mocha test", | ||
"froze": "npm shrinkwrap" | ||
@@ -46,3 +49,3 @@ }, | ||
"cli-table" : "0.2.0", | ||
"multimeter": "git://github.com/Alexandre-Strzelewicz/node-multimeter.git", | ||
"multimeter": "git://github.com/Unitech/node-multimeter.git", | ||
"usage" : "0.3.5", | ||
@@ -49,0 +52,0 @@ "axon-rpc" : "0.0.2", |
@@ -11,2 +11,4 @@ ![Monit](https://github.com/unitech/pm2/raw/master/pres/pm2.png) | ||
Tested with Node v0.8, v0.10, v0.11 | ||
# Installation | ||
@@ -31,3 +33,3 @@ | ||
$ pm2 stopAll // Stop all processes | ||
$ pm2 resurect // Put online previously dumped processes | ||
$ pm2 resurrect // Put online previously dumped processes | ||
$ pm2 restart pm2_id // Restart specific process | ||
@@ -52,2 +54,11 @@ $ pm2 restartAll // Restart all proccesses | ||
## Updating pm2 and keeping processes alive | ||
``` | ||
$ pm2 dump | ||
$ npm install -g pm2@latest | ||
$ pm2 kill | ||
$ pm2 resurrect | ||
``` | ||
## pm2 list | ||
@@ -71,6 +82,6 @@ | ||
## pm2 dump/resurect | ||
## pm2 dump/resurrect | ||
You can dump all currently running processes, including their environment and execution path. | ||
After restarting or stopping PM2 you can `resurect` them. | ||
After restarting or stopping PM2 you can `resurrect` them. | ||
@@ -87,3 +98,2 @@ ![Monit](https://github.com/unitech/pm2/raw/master/pres/pm2-resurect.png) | ||
# Features | ||
@@ -90,0 +100,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
446503
1150
186