diff options
-rwxr-xr-x | rtr-origin/rtr-origin.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/rtr-origin/rtr-origin.py b/rtr-origin/rtr-origin.py index d2e9994d..5ebc0401 100755 --- a/rtr-origin/rtr-origin.py +++ b/rtr-origin/rtr-origin.py @@ -1357,8 +1357,14 @@ def kick_all(serial): try: blather("# Kicking %s" % name) sock.sendto(msg, name) - except: - log("# Failed to kick %s" % name) + except socket.error: + try: + blather("# Failed to kick %s, probably dead socket, attempting cleanup" % name) + os.unlink(name) + except Exception, e: + blather("# Couldn't unlink suspected dead socket %s: %s" % (name, e)) + except Exception, e: + log("# Failed to kick %s and don't understand why: %s" % (name, e)) sock.close() def cronjob_main(argv): |