rename PM2 and clustered processes when running (vizible with ps or htop)

This commit is contained in:
tknew2 2014-11-07 01:25:44 +01:00
parent 9d1d115df2
commit 8dbdf00b36
4 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,7 @@
# 0.11.2
- Rename process running with PM2 <version> - app_name
- Inner iteraction with PM2 possible #782
- Better vizion system
- backward / forward / pull command

View File

@ -12,6 +12,8 @@ var cst = require('../../constants.js');
var util = require('util');
var Common = require('../Common');
var pkg = require('../../package.json');
/**
* Description
* @method exports
@ -39,6 +41,8 @@ module.exports = function ClusterMode(God) {
cluster.settings.execArgv = env_copy.node_args;
}
env_copy._pm2_version = pkg.version;
try {
clu = cluster.fork(env_copy);
} catch(e) {

View File

@ -4,7 +4,7 @@
// Rename process
if (process.env.name != null)
process.title = 'pm2: ' + process.env.name;
process.title = 'PM2 v' + process.env._pm2_version + ': ' + process.env.name;
var fs = require('fs');
var p = require('path');

View File

@ -586,6 +586,9 @@ Satan.unlock = function(opts, cb) {
// this process is being forked by pm2 itself
//
if (require.main === module) {
process.title = 'pm2: Daemon';
var pkg = require('../package.json');
process.title = 'PM2 v' + pkg.version + ': God Daemon';
Satan.remoteWrapper();
}