<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def shutdown(self, signum):
 """Handle all signals which trigger a process stop. This method should run all appropriate signal handlers registered through the 'handle' method. At the end it should cause the process to exit with a status code. If any of the handlers raise an exception the exit code should be SHUTDOWN_FAILED otherwise SUCCESS. """

        dirty = False
        for handler in self._handlers[signum]:

            try:

                handler()

            except:

                LOG.exception("A shutdown handler failed to execute:")
                dirty = True

        del self.pid

        if dirty:

            sys.exit(exit.SHUTDOWN_FAILED)
            return None

        sys.exit(exit.SUCCESS)
        return None