'Read the heartbeat or stop message from the parent process'

def _readParentMessage(self):

    line = sys.stdin.readline()
    if (not line):
        return
    if (line == 'hello\n'):
        self.parentMonitor.heartbeat()
        return
    if (line == 'seeya\n'):
        try:
            self.agentProcess.stop()
            self.parentMonitor.stop()
        finally:
            os._exit(0)
