|
|
@ -94,6 +94,18 @@ shepherd.appConfig = { |
|
|
|
"v2": false |
|
|
|
}; |
|
|
|
|
|
|
|
shepherd.quitKomodod = function() { |
|
|
|
// exit komodod gracefully
|
|
|
|
console.log('exec ' + komodocliBin + ' stop'); |
|
|
|
exec(komodocliBin + ' stop', function(error, stdout, stderr) { |
|
|
|
console.log('stdout: ' + stdout) |
|
|
|
console.log('stderr: ' + stderr) |
|
|
|
if (error !== null) { |
|
|
|
console.log('exec error: ' + error) |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
shepherd.saveLocalAppConf = function(appSettings) { |
|
|
|
var appConfFileName = iguanaDir + '/config.json'; |
|
|
|
|
|
|
@ -738,6 +750,17 @@ function herder(flock, data) { |
|
|
|
portscanner.checkPortStatus(_port, '127.0.0.1', function(error, status) { |
|
|
|
// Status is 'open' if currently in use or 'closed' if available
|
|
|
|
if (status === 'closed') { |
|
|
|
// start komodod via exec
|
|
|
|
if (data.ac_name === 'komodod') { |
|
|
|
console.log('exec' + komododBin + ' -' + data.ac_options.join(' ')); |
|
|
|
exec(komododBin + ' -' + data.ac_options.join(' '), function(error, stdout, stderr) { |
|
|
|
console.log('stdout: ' + stdout) |
|
|
|
console.log('stderr: ' + stderr) |
|
|
|
if (error !== null) { |
|
|
|
console.log('exec error: ' + error) |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
pm2.connect(true, function(err) { // start up pm2 god
|
|
|
|
if (err) { |
|
|
|
console.error(err); |
|
|
@ -756,6 +779,7 @@ function herder(flock, data) { |
|
|
|
throw err; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.log('port ' + _port + ' (' + data.ac_name + ') is already in use'); |
|
|
|
} |
|
|
|