'Listen for the shutdown messages'

def run(self):

    try:
        sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        sock.bind((self.settings.shutdownAgentBindAddr, self.settings.shutdownAgentBindPort))
    except Exception as e:
        self.logger.error(traceback.format_exc(e))
    self.logger.info(('Shutdown    listener    bound    to    address    %s    on    port    %d' % (self.settings.shutdownAgentBindAddr, self.settings.shutdownAgentBindPort)))
    while True:
        try:
            time.sleep(5)
            (data, addr) = sock.recvfrom(1024)
            if (data != self.settings.shutdownAgentBindChallenge):
                self.logger.error(('received    bad    shutdown    message    from:    %s' % addr[0]))
            else:
                self.logger.info(('received    valid    shutdown    message    from:    %s    -    exiting' % addr[0]))
                os._exit(0)
        except:
            pass
