From 915acc3c4f480588a1e3015a7b474206d4de5ee0 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Thu, 13 Mar 2008 14:50:33 +0000 Subject: [PATCH] detect postgres death in recovery --- python/walmgr.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/walmgr.py b/python/walmgr.py index 7b3c07b1..a26472f5 100755 --- a/python/walmgr.py +++ b/python/walmgr.py @@ -890,6 +890,15 @@ class WalMgr(skytools.DBScript): self.log.info("%s: not found, stopping" % srcname) sys.exit(1) + # nothing to do, just in case check if parent is alive + try: + os.kill(os.getppid(), 0) + except OSError, ex: + if ex.errno == errno.ESRCH: + self.log.info("%s: not found, stopping" % srcname) + sys.exit(1) + self.log.warning("Parent aliveness check failed: "+str(ex)) + # nothing to do, sleep self.log.debug("%s: not found, sleeping" % srcname) time.sleep(1) -- 2.39.5