How to use the pm2.sendSignalToProcessName function in pm2

To help you get started, we’ve selected a few pm2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 1956-studio / wechat-ship / client / controllers / server.js View on Github external
server.reload = function (name, cb) {
	pm2.sendSignalToProcessName('SIGTERM', name, function (err) {
		if(err) {
			log.applog('error', 'pm2 List faild: ' + err);
		}
		return cb(err);
	});
}
github TradaTech / icetea / common / pm2-monitor.js View on Github external
bus.on('process:event', function (data) {
    if (data.event === 'exit') {
      const name = data.process.name
      if (name === iceteaName) {
        debug('Icetea node exited, sending SIGTERM to tendermint node')
        pm2.sendSignalToProcessName('SIGTERM', tendermintName)
      }
    }
  })
})