* Kill Daemon * * @param {Function} cb Callback
(cb)
| 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); |
no test coverage detected