def _shutdown(self, signum=None, frame=None, exitcode=0, exception=False):
        # Ignore if we are already stopping
        if self.pluginmgr and self.pluginmgr.stopping:
            return

        lg.info("Shutting down")
        try:
            # Shutdown webserver
            if self.server:
                self.server.terminate()
                self.server.join()

            # Shutdown pluginmanager and all plugins
            if self.pluginmgr:
                self.pluginmgr.stop()

            # Remove PID file if exists
            if os.path.isfile(self.conf['pidfile']):
                os.remove(self.conf['pidfile'])
        except Exception as e:
            lg.exception(e)
            if exception:
                raise

        sys.exit(exitcode)
Shutdown smoker daemon (internal use)
dataset/ETHPy150Open gooddata/smoker/smoker/server/daemon.py/Smokerd._shutdown