mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
This commit is contained in:
parent
559f628085
commit
ddcc5cc9d8
@ -441,7 +441,13 @@ CLI.interact = function(secret_key, public_key, machine_name, cb) {
|
||||
secret_key : secret_key || null,
|
||||
public_key : public_key || null,
|
||||
machine_name : machine_name || null
|
||||
}, cb);
|
||||
}, function(err, dt) {
|
||||
if (err) {
|
||||
printError(err);
|
||||
return cb ? cb({msg:err}) : exitCli(cst.ERROR_EXIT);
|
||||
}
|
||||
return cb ? cb(null, {success:true}) : exitCli(cst.SUCCESS_EXIT);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -72,7 +72,7 @@ function handleExit(clu, exit_code) {
|
||||
|
||||
var stopping = (clu.pm2_env.status == cst.STOPPING_STATUS || clu.pm2_env.status == cst.ERRORED_STATUS) ? true : false;
|
||||
var overlimit = false;
|
||||
var pidFile = [clu.pm2_env.pm_pid_path, clu.pm2_env.pm_id, '.pid'].join('');
|
||||
var pidFile = clu.pm2_env.pm_pid_path;
|
||||
|
||||
if (stopping) clu.process.pid = 0;
|
||||
|
||||
@ -152,6 +152,9 @@ God.executeApp = function(env, cb) {
|
||||
env_copy['restart_time'] = 0;
|
||||
env_copy['unstable_restarts'] = 0;
|
||||
|
||||
// add -pm_id to pid file
|
||||
env_copy.pm_pid_path = env_copy.pm_pid_path.replace(/-[0-9]+\.pid$|\.pid$/g, '-' + env_copy['pm_id'] + '.pid');
|
||||
|
||||
// If merge option, dont separate the logs
|
||||
if (!env_copy['merge_logs']) {
|
||||
env_copy.pm_out_log_path = env_copy.pm_out_log_path.replace(/-[0-9]+\.log$|\.log$/g, '-' + env_copy['pm_id'] + '.log');
|
||||
|
||||
@ -19,7 +19,7 @@ require('coffee-script/register');
|
||||
var outFile = process.env.pm_out_log_path;
|
||||
var errFile = process.env.pm_err_log_path;
|
||||
var pmId = process.env.pm_id;
|
||||
var pidFile = [process.env.pm_pid_path, pmId, '.pid'].join('');
|
||||
var pidFile = process.env.pm_pid_path;
|
||||
var script = process.env.pm_exec_path;
|
||||
var cronRestart = process.env.cron_restart;
|
||||
|
||||
|
||||
@ -219,6 +219,9 @@ Satan.remoteWrapper = function() {
|
||||
return God.clusters_db[pm2_env.pm_id].pm2_env.axm_actions.push(msg.data.data);
|
||||
});
|
||||
|
||||
/**
|
||||
* Launch Interactor
|
||||
*/
|
||||
InteractorDaemonizer.launchAndInteract({}, function(err, data) {
|
||||
God.bus.onAny(function(data_v) {
|
||||
debug(this.event);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user