From: Bernhard Tittelbach Date: Sun, 20 Sep 2009 03:27:29 +0000 (+0000) Subject: eof detection X-Git-Url: https://git.realraum.at/?p=svn42.git;a=commitdiff_plain;h=3ee5facd769b111061569c3047a63d33efaa2aef eof detection --- diff --git a/update-web-status.py b/update-web-status.py index e2eec66..c4fffa6 100755 --- a/update-web-status.py +++ b/update-web-status.py @@ -200,7 +200,7 @@ while True: if not os.path.exists(socketfile): logging.debug("Socketfile '%s' not found, waiting 5 secs" % socketfile) time.sleep(5) - continue + continue sockhandle = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sockhandle.connect(socketfile) conn = os.fdopen(sockhandle.fileno()) @@ -212,6 +212,9 @@ while True: uwscfg.checkConfigUpdates() + if line == "": + raise Exception("EOF on Socket, daemon seems to have quit") + m = RE_STATUS.match(line) if not m is None: status = m.group(1) diff --git a/update-xmpp-status.py b/update-xmpp-status.py index 24aef04..a6d1331 100755 --- a/update-xmpp-status.py +++ b/update-xmpp-status.py @@ -283,6 +283,9 @@ while True: uwscfg.checkConfigUpdates() + if line == "": + raise Exception("EOF on Socket, daemon seems to have quit") + m = RE_STATUS.match(line) if not m is None: status = m.group(1)