If sub-classed, run any shutdown operations on this method.

        :param exitcode
        :param exitmsg
19055
def shutdown(self, exitcode=0, exitmsg=None):
        '''
        
        '''
        self.action_log_info('Shutting down')
        if hasattr(self, 'minion') and hasattr(self.minion, 'destroy'):
            self.minion.destroy()
        super(Minion, self).shutdown(
            exitcode, ('The Salt {0} is shutdown. {1}'.format(
                self.__class__.__name__, (exitmsg or '')).strip()))
740683
def exit(self, status=0, message=None):
        
        if message:
            raise HelpBanner(message.strip(), code=status)
759029
public void shutdown(ShutdownModeAmp mode,
                       ExitCode exitCode, 
                       String msg)
  {
    shutdown(mode, exitCode, msg, null);
  }
1252229
def exit(exit_code=0):
    

    LOGGER.debug("> {0} | Exiting current process!".format(__name__))

    LOGGER.debug("> Stopping logging handlers and logger!")
    for handler in LOGGER.handlers:
        foundations.verbose.remove_logging_handler(handler)

    sys.exit(exit_code)
1271054
def exit_ok(self, message, exit_code=None):
        
        logger.info("Exiting...")
        if message:
            logger.info("-----")
            logger.error("Exit message: %s", message)
            logger.info("-----")

        self.request_stop()

        if exit_code is not None:
            exit(exit_code)
281489
def exit(self, status=0, message=None):
        
        if status:
            self.logger.error(message)
        if self.__parser__:  # pylint: disable-msg=E1101
            self.__parser__.exit(status, message)  # pylint: disable-msg=E1101
        else:
            sys.exit(status)
176038
def abort(code, error=None, message=None):
    
    if error is None:
        flask_abort(code)
    elif isinstance(error, Response):
        error.status_code = code
        flask_abort(code, response=error)
    else:
        body = {
            "status": code,
            "error": error,
            "message": message
        }
        flask_abort(code, response=export(body, code))
613787
def handle_command_exit_code(self, code):
        
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"],
                ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr,
                    ca["truncate_exc"])
            raise exc
399980
def quit(self, exit_code=0, event=None):
        

        # --- Running on_close components methods. ---
        for component in reversed(self.__components_manager.list_components()):
            interface = self.__components_manager.get_interface(component)
            if not interface:
                continue

            if not interface.activated:
                continue

            if not hasattr(interface, "on_close"):
                continue

            if not interface.on_close():
                event and event.ignore()
                return

        # Storing current layout.
        self.__layouts_manager.store_startup_layout()
        self.__settings.settings.sync()

        # Stopping worker threads.
        for worker_thread in self.__worker_threads:
            LOGGER.debug("> Stopping worker thread: '{0}'.".format(worker_thread))
            if not worker_thread.isFinished():
                worker_thread.quit()
            worker_thread.wait()

        foundations.verbose.remove_logging_handler(self.__logging_file_handler)
        foundations.verbose.remove_logging_handler(self.__logging_session_handler)
        # foundations.verbose.remove_logging_handler(self.__logging_console_handler)

        # Stopping the Application timer.
        self.__timer.stop()
        self.__timer = None

        self.deleteLater()
        event and event.accept()

        exit(exit_code)
652858
def exit(self, status=0, message=None):
        '''
        
        '''
        self.exited = True
        if message is not None:
            self.mesgs.extend(message.split('\n'))
        raise s_exc.BadSyntax(mesg=message, prog=self.prog, status=status)
345069
def _exit_handler(self):
        

        # TODO: consider handling sys.stderr/sys.stdout exceptions related to
        # TODO (cont.): order of interpreter vs. subprocess shutdown signal receipt.
        # TODO (cont.): see https://bugs.python.org/issue11380


        # Make the cleanup file executable if it exists
        if os.path.isfile(self.cleanup_file):
            # Make the cleanup file self destruct.
            with open(self.cleanup_file, "a") as myfile:
                myfile.write("rm " + self.cleanup_file + "\n")
            os.chmod(self.cleanup_file, 0o755)

        # If the pipeline hasn't completed successfully, or already been marked
        # as failed, then mark it as failed now.

        if not self._has_exit_status:
            print("Pipeline status: {}".format(self.status))
            self.fail_pipeline(Exception("Pipeline failure. See details above."))

        if self.tee:
            self.tee.kill()
976349
def __exitfunction(self):
        '''
        
        '''
        if self._hook.exit_code is None and self._hook.exception is None:
            print("Check did not exit! You should call an exit code method.")
            sys.stdout.flush()
            os._exit(1)
        elif self._hook.exception:
            print("Check failed to run: %s, %s" %
                  (sys.last_type, traceback.format_tb(sys.last_traceback)))
            sys.stdout.flush()
            os._exit(2)
632726
def exit(code=0, text=''):
    
    if not isinstance(text, basestring_type):
        text = unicode_type(text)
    if code > 0:
        if text:
            if not isinstance(text, basestring_type):
                text = unicode_type(text)
            sys.stderr.write(text)
        sys.exit(code)
    else:
        if text:
            print(text)
        sys.exit(0)
705677
def kill(self, exit_code: Any = None):
        
        self._force_kill.set()
        if exit_code is not None:
            self._exit_code = exit_code
        logger.info("Killing behavior {0} with exit code: {1}".format(self, exit_code))
567285
def run_and_exit_if(opts, action, *names):
    
    for name in names:
        if name in opts:
            action()
            sys.exit(0)
967092
def _termination_callback(self, returncode):
        

        log.info("uBridge process has stopped, return code: %d", returncode)
        if returncode != 0:
            self._project.emit("log.error", {"message": "uBridge process has stopped, return code: {}\n{}".format(returncode, self.read_stdout())})
321433
def error(self):
        
        if self.__timed_out:
            return TimeoutError(self.session, self, "timeout")
        if self.__exit_code is not None and \
                self.__expected_exit_code is not None and \
                self.__exit_code != self.__expected_exit_code:
            return ExitCodeError(self.session, self,
                                 'bad exit code: Got %s' % self.__exit_code)