change motd

This commit is contained in:
Unitech 2017-11-22 15:44:18 +01:00
parent f6c70529bb
commit 13a6b266cb
5 changed files with 52 additions and 59 deletions

View File

@ -21,6 +21,7 @@ var Config = require('./tools/Config');
var Modularizer = require('./API/Modules/Modularizer.js');
var path_structure = require('../paths.js');
var UX = require('./API/CliUx');
var pkg = require('../package.json');
var IMMUTABLE_MSG = chalk.bold.blue('Use --update-env to update environment variables');
@ -384,18 +385,25 @@ API.prototype.update = function(cb) {
// Dump PM2 processes
that.Client.executeRemote('notifyKillPM2', {}, function() {});
that.dump(function(err) {
debug('Dumping successfull', err);
that.killDaemon(function() {
debug('------------------ Everything killed', arguments);
that.Client.launchDaemon({interactor:false}, function(err, child) {
that.Client.launchRPC(function() {
that.resurrect(function() {
Common.printOut(chalk.blue.bold('>>>>>>>>>> PM2 updated'));
Modularizer.launchAll(that, function() {
KMDaemon.launchAndInteract(that._conf, null, function(err, data, interactor_proc) {
// Interactor error can be skipped here
return cb ? cb(null, {success:true}) : that.speedList();
that.getVersion(function(err, new_version) {
if (!err && (pkg.version != new_version)) {
var dt = fs.readFileSync(path.join(__dirname, that._conf.KEYMETRICS_UPDATE));
console.log(dt.toString());
}
that.dump(function(err) {
debug('Dumping successfull', err);
that.killDaemon(function() {
debug('------------------ Everything killed', arguments);
that.Client.launchDaemon({interactor:false}, function(err, child) {
that.Client.launchRPC(function() {
that.resurrect(function() {
Common.printOut(chalk.blue.bold('>>>>>>>>>> PM2 updated'));
Modularizer.launchAll(that, function() {
KMDaemon.launchAndInteract(that._conf, null, function(err, data, interactor_proc) {
// Interactor error can be skipped here
return cb ? cb(null, {success:true}) : that.speedList();
});
});
});
});
@ -615,29 +623,19 @@ API.prototype.killDaemon = API.prototype.kill = function(cb) {
that.Client.executeRemote('notifyKillPM2', {}, function() {});
that.getVersion(function(err, data) {
if (!err && semver.lt(data, '1.1.0')) {
// Disable action command output if upgrading from < 1.1.0 PM2
// This is in order to avoid duplicated output
process.env.PM2_SILENT = 'true';
console.log(conf.PREFIX_MSG + 'Killing processes...');
}
that.killAllModules(function() {
that._operate('deleteProcessId', 'all', function(err, list) {
Common.printOut(conf.PREFIX_MSG + 'All processes have been stopped and deleted');
process.env.PM2_SILENT = 'false';
that.killAllModules(function() {
that._operate('deleteProcessId', 'all', function(err, list) {
Common.printOut(conf.PREFIX_MSG + 'All processes have been stopped and deleted');
process.env.PM2_SILENT = 'false';
that.killInteract(function(err, data) {
that.Client.killDaemon(function(err, res) {
if (err) Common.printError(err);
Common.printOut(conf.PREFIX_MSG + 'PM2 stopped');
return cb ? cb(err, res) : that.exitCli(conf.SUCCESS_EXIT);
});
that.killInteract(function(err, data) {
that.Client.killDaemon(function(err, res) {
if (err) Common.printError(err);
Common.printOut(conf.PREFIX_MSG + 'PM2 stopped');
return cb ? cb(err, res) : that.exitCli(conf.SUCCESS_EXIT);
});
});
});
});
};

View File

@ -5,4 +5,4 @@
/_/ |_\___/\__, /_/ /_/ /_/\___/\__/_/ /_/\___/____/
/____/
A Node.js monitoring solution you will love
Harden your Node.js application, today

View File

@ -1,25 +0,0 @@
-------------
Looking for a complete monitoring and management tool for PM2?
_ _ _ _
| | _____ _ _ _ __ ___ ___| |_ _ __(_) ___ ___ (_) ___
| |/ / _ \ | | | '_ ` _ \ / _ \ __| '__| |/ __/ __| | |/ _ \
| < __/ |_| | | | | | | __/ |_| | | | (__\__ \_| | (_) |
|_|\_\___|\__, |_| |_| |_|\___|\__|_| |_|\___|___(_)_|\___/
|___/
Features
- Real Time Dashboard
- CPU/Memory monitoring
- HTTP monitoring
- Event notification
- Custom value monitoring
- Real Time log display
Checkout
https://keymetrics.io/
-------------

View File

@ -12,7 +12,9 @@ __/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
_\///______________\///______________\///__\///////////////__
Production Process Manager for Node.js apps
Community Edition
Production Process Manager for Node.js applications
with a built-in Load Balancer.
@ -29,7 +31,7 @@ __/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
$ pm2 startup
To go further checkout:
http://pm2.io
http://pm2.io/
-------------

18
lib/motd.update Normal file
View File

@ -0,0 +1,18 @@
-------------
__ __ __ _
/ //_/__ __ ______ ___ ___ / /______(_)_________
/ ,< / _ \/ / / / __ `__ \/ _ \/ __/ ___/ / ___/ ___/
/ /| / __/ /_/ / / / / / / __/ /_/ / / / /__(__ )
/_/ |_\___/\__, /_/ /_/ /_/\___/\__/_/ /_/\___/____/
/____/
Start monitoring your Node.js application today
$ pm2 monitor
To know more about the PM2 monitoring solution:
https://keymetrics.io/
-------------