Exemplo n.º 1
0
    getServer(function (data) {
      if (!data) {
        console.log('Crypton is not running');
        process.exit(1);
      }

      forever.stop(data.index);
      console.log('Crypton server stopped');
    });
Exemplo n.º 2
0
forever.list(false, function(err, data) {
  if (err) throw err;
  if (data == null) return;
  for (var i = 0; i < data.length; i++) {
    if (data[i].uid === 'fbash'){
      forever.stop(i);
    }
  }
});
Exemplo n.º 3
0
caddis.stop = function(callback) {
  forever.stop(caddis.server)
    .on('stop', function() {
      callback();
    })
    .on('error', function(err) {
      callback(err);
    });
};
Exemplo n.º 4
0
	function stopServer() {
		if (that.settings.forever.enabled) {
			forever.stop();
		}
		else {
			that.proc.kill('SIGINT');
			//kill(that.pid);
		}
		log.info('Stopping Server Container');
	}
Exemplo n.º 5
0
 forever.list(null, function(err, processes) {
     if (err) {
         throw err;
     }
     var process = _.findWhere(processes, { file: SERVER_PATH });
     if (!process) {
         return console.log('No octoppi server is running.');
     }
     forever.stop(_.indexOf(processes, process));
 });
Exemplo n.º 6
0
  findProcessWithIndex( index, function(process) {
    if(typeof process !== 'undefined') {
      log(forever.format(true,[process]));

      forever.stop(index).on('stop', function(){
          startRequest();
      })

    }
    else {
      log(index + ' not found in list of processes in forever. Starting new instance...');
      startRequest();
      done();
    }
  });
Exemplo n.º 7
0
  findProcessWithIndex( index, function(process) {
    if( typeof process !== 'undefined' ) {
      log( forever.format(true,[process]) );

      forever.stop( index )
        .on('stop', function() {
          done();
        })
        .on('error', function(message) {
          error( 'Error stopping ' + index + '. [REASON] :: ' + message );
          done(false);
        });
    }
    else {
      gruntRef.warn( index + ' not found in list of processes in forever.' );
      done();
    }
  });
Exemplo n.º 8
0
module.exports = function(command) {
  switch (command || 'start') {
    case 'start':
      startDaemon(path.join(__dirname, 'server.js'));
      startDaemon(path.join(__dirname, 'kafka.js'));
      break;
    case 'stop':
      forever.stop(args[2]);
      break;
    case 'list':
      forever.list(true, function(err, list) {
        console.log(list);
      });
      break;
    case 'stopall':
      forever.stopAll(true);
      break;
  }
};
Exemplo n.º 9
0
Arquivo: ci.js Projeto: nprds/node-ci
  util.getProcessIndexbyID(uid, function(err, processIndex) {

    if (err) {
      GLOBAL.messages.push({ type: 'error', copy: 'Unable to find the process to stop.'});
      res.redirect('/');
      return;
    }

    if (!processIndex) {
      GLOBAL.messages.push({ type: 'error', copy: 'Unable to find the process using UID, attempting Index.'});
      processIndex = parseInt(req.params.index);
    }

    util.logNow({ owner: req.session.user.github.name, name: 'Stopping Process', message: 'Manual Action to stop a process, idx: ' + processIndex });

    forever.stop(processIndex);

    GLOBAL.messages.push({ type: 'info', copy: 'Stopping the build process.'});
    res.redirect('/');
  });
Exemplo n.º 10
0
  findProcessWithIndex( index, function(process) {
    if( typeof process !== 'undefined' ) {
      log( forever.format(true,[process]) );

      forever.stop( index )
        .on('stop', function() {
          done();
        })
        .on('error', function(message) {
          error( 'Error stopping ' + index + '. [REASON] :: ' + message );
          done(false);
        });
    }
    else {
      warn( index + ' not found in list of processes in forever.' );

      // send mail with defined transport object
      smtpTransport.sendMail(extend(mailOptions, {
        subject: 'Server down ✔',
        text: 'Just now server is restarting. But limits have been exhausted ✔',
        html: '<b>Just now server is restarting. But limits have been exhausted ✔</b>'
      }), function(error, response) {
        if (error) log(error);
        else log('Message sent: ' + response.message);
     
        if (commandFinish) {
          log( 'exec: '+ commandFinish );

          var exec = require('child_process').exec;
          exec(commandFinish, function(error, stdout, stderr) {
            if (!error) startRequest();
            done();
          });
        }
        else {
          done();
        }
      });
    }
  });
Exemplo n.º 11
0
	isProcessRunning(uid, function(running) {
	    if (running) {
	        forever.stop(uid);
	    }
	});
Exemplo n.º 12
0
 processes.forEach(function (proc, index) {
     if (proc.logFile === logFile) forever.stop(index);
 });