<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def harakiri(self, *_):
 """ Handles the reception of a timeout signal indicating that a request has been processing for too long, as defined by the Harakiri settings. """

        if self.shutting_down:
            self.logger.warning('Graceful shutdown failed after {}s. Exiting now!'.format(
                self.settings['harakiri']['shutdown_grace']
            ))
            sys.exit(1)
        else:
            self.logger.warning('No activity during {}s, triggering harakiri with grace {}s'.format(
                self.settings['harakiri']['timeout'],
                self.settings['harakiri']['shutdown_grace'],
            ))
            self.shutting_down = True
            signal.alarm(self.settings['harakiri']['shutdown_grace'])