'Enable SIGTERM and SIGINT handlers'

def register_signal_handlers(self):

    try:
        signal.signal(signal.SIGTERM, self._handle_sigterm)
        signal.signal(signal.SIGINT, self._handle_sigterm)
    except ValueError:
        log.exception('Unable    to    register    signal    handlers.')
