[ZODB-Dev] Startup errors handled poorly

Jim Fulton jim@digicool.com
Thu, 21 Jun 2001 17:55:07 -0400


Greg Ward wrote:
> 
> Hi all --
> 
> using the zeod script distributed by Andrew from SourceForge (a modified
> version of ZEO's start.py), I am experiencing some *intensely* annoying
> bugs when zeod has problems starting up.  Mainly, this happens when it
> can't write to its file (eg. I've just created, but forgotten to chgrp
> and chmod g+w it), or if the daemon is already running.  Since this is a
> development environment and I am only human, these both happen fairly
> often.
> 
> The two problems, in order of increasing annoyance, are:
>   * the error traceback happens in a child process post-forking,
>     so it's scrambled with my shell prompt or anything else
>     that might come on stdout after the original zeod process
>     (the forking parent) exits

You should use zLOG to get the errors to go to a log file.

>   * the error traceback is repeated ad infinitum -- in a forked
>     child, so I can't just "Ctrl-C" it, or "kill %1" it -- I
>     have to open another terminal window, "ps ... | grep" for it,
>     and *then* kill it.  Arghh!!

This problem should be fixed in the current CVS.
We changed the way startup errors were handled by zdaemon
and we forgot to make the necessary change to 
start.py till some time later.
 
> Has anyone else experienced these problems, either with Andrew's zeod or
> with DC's start.py? 

Yes.

> Anyone have any clues how to fix them?  Or should I
> do my bit of community service and spend a morning drilling in?

zdaemon will restart the application if it exits with a non-zero
exit status.  (It used to not restart if the child died within
20 seconds, but this was lame and caused the application to not
restarted when it should.)

Your startup script should be careful to catch non-recoverable 
startup errors and exit with a zero exit startus.  See our latest
start.py.

Jim


--
Jim Fulton           mailto:jim@digicool.com   Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Digital Creations    http://www.digicool.com   http://www.zope.org