MCPcopy
hub / github.com/Unitech/pm2 / killDaemon

Method killDaemon

lib/API.js:629–653  ·  view source on GitHub ↗

* Kill Daemon * * @param {Function} cb Callback

(cb)

Source from the content-addressed store, hash-verified

627 * @param {Function} cb Callback
628 */
629 killDaemon (cb) {
630 process.env.PM2_STATUS = 'stopping'
631
632 var that = this;
633
634 that.Client.executeRemote('notifyKillPM2', {}, function() {});
635
636 that._operate('deleteProcessId', 'all', function(err, list) {
637 Common.printOut(conf.PREFIX_MSG + '[v] All Applications Stopped');
638 process.env.PM2_SILENT = 'false';
639
640 that.killAgent(function(err, data) {
641 if (!err) {
642 Common.printOut(conf.PREFIX_MSG + '[v] Agent Stopped');
643 }
644
645 that.Client.killDaemon(function(err, res) {
646 if (err) Common.printError(err);
647 Common.printOut(conf.PREFIX_MSG + '[v] PM2 Daemon Stopped');
648 return cb ? cb(err, res) : that.exitCli(conf.SUCCESS_EXIT);
649 });
650
651 });
652 })
653 }
654
655 kill (cb) {
656 this.killDaemon(cb);

Callers 7

destroyMethod · 0.95
killMethod · 0.95
updateMethod · 0.80
CLI.jsFile · 0.80
client.mocha.jsFile · 0.80
API.min.jsFile · 0.80
API.jsFile · 0.80

Calls 3

cbFunction · 0.85
_operateMethod · 0.80
exitCliMethod · 0.80

Tested by

no test coverage detected