Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// TODO: change these files paths, right now they output to user's home location on remote server
// due to the fact that the process.cwd() is /home/cdopuch
var daemon = forever.startDaemon(
daemonFilePath,
{
// NOTE: these log files are truncated on each new run
// TODO: rotate the logs so we can save old logs
'logFile': 'new-remote-daemon.log',
'outFile': 'new-remote-daemon-stdout.log',
'errFile': 'new-remote-daemon-stderr.log',
'max': 1,
'uid': 'remote-daemon'
}
);
var server = forever.startServer(daemon);
// process.stdout.write('[remote.js] up and waiting');
console.log('[remote.js] up and waiting');
function start_service(service) {
if (services[service]) {
if (services[service].running) {
zen.send_admin_message(service + ' is already running');
} else {
zen.send_admin_message('starting ' + service);
services[service].start();
}
} else {
zen.send_admin_message('starting ' + service);
child = forever.start([language_map[service.split('.')[1]], service], {
max: 10000,
silent: false
});
forever.startServer(child);
services[service] = child;
forever.cli.list();
}
}
var forever = require('forever');
var child = forever.start([ 'socketstream', 'start' ], {
max : 1,
silent : true
});
forever.startServer(child);
var startBalancer = function () {
var child = forever.startDaemon(balancerFilePath, {
uid: balancerUid,
max: MAX_RESTARTS,
logFile: logFileName,
outFile: logFileName,
errFile: logFileName,
args: commandRawArgs
});
forever.startServer(child);
successMessage('Started loadbalancer - Logging to ' + logFileName);
};