Commit 0b1989ff authored by Jim Fulton's avatar Jim Fulton

Added a check for sudden death of child, presumably due to a startup error.

parent aecc55c4
...@@ -173,6 +173,7 @@ def run(argv, pidfile=''): ...@@ -173,6 +173,7 @@ def run(argv, pidfile=''):
if os.environ.has_key('ZDEAMON_MANAGED'): return if os.environ.has_key('ZDEAMON_MANAGED'): return
os.environ['ZDEAMON_MANAGED']='TRUE' os.environ['ZDEAMON_MANAGED']='TRUE'
while 1: while 1:
lastt=time.time()
try: try:
pid = forkit() pid = forkit()
...@@ -200,6 +201,8 @@ def run(argv, pidfile=''): ...@@ -200,6 +201,8 @@ def run(argv, pidfile=''):
if s: if s:
pstamp(('Aiieee! %s exited with error code: %s' pstamp(('Aiieee! %s exited with error code: %s'
% (p, s))) % (p, s)))
if time.time()-lastt < 20:
raise ForkError # We're probably hosed
else: else:
raise ForkError raise ForkError
pstamp(('The kid, %s, died on me.' % pid)) pstamp(('The kid, %s, died on me.' % pid))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment