[Zope-dev] Is there an alternative to zdaemon?

Jim Fulton jim at zope.com
Fri Dec 22 15:55:48 EST 2006


Yesterday I started working on some updates to zdaemon.  zdaemon is pretty
cool.  It is a Unix-only tool that:

- Turns an arbitrary program into a fairly well-behaved daemon

- Provides management of an applications output as a log file.

- Provides start, stop and restart commands for starting or stopping
   applications.

- Provides a status command for finding out if an app is running.

- Provides a kill command for sending an app a signal (e.g. for
   log rotation).

- Automatically restarts applications that exit abnormally, with a
   fairly reasonable approach for limiting restart attempts in case
   something is failing on startup.

- Provides a number of useful configuration settings that can
   be managed using a clean (ZConfig-based) log file.

It is written in Python, but it can control any program.  We're using
it to control spread, which is a C program.  spread comes with it's
own Red Hat startup script, but spread fails to detach from the
controlling terminal.  zdaemon makes it behave properly and provides
a startup script that will work on any Unix-like system.

It has 2 major disadvantages:

- It is ours. :)  We are bearing the burden of maintaining it.
   This is offset by the fact that it hasn't required much maintenance.

- It is largely undocumented. This makes it much harder to use than it
   needs to be.  It also makes it under appreciated.  I made a start at
   fixing this yesterday:

     http://svn.zope.org/zdaemon/trunk/src/zdaemon/README.txt?view=auto

  It isn't very hard to use, so documenting it isn't really all that hard.

I wonder if we should be using some other daemon manager.  Arguably, there's
no reason for the Zope project to maintain one if something is available
that does what we need.  Does anyone know of something that does what zdaemon
does?  daemontools seems somewhat close:

   http://cr.yp.to/daemontools.html

Going from the documentation, it doesn't seem to be as clever about
application restart.  The documentation says nothing about distinguishing
between normal and abnormal restarts or avoiding useless restarts when there
are start-up errors.

If we do continue to maintain zdaemon, we really should publicize it more
widely, both to get credit and to get more people interested in maintaining
it.

Because I want the enhancements I'm making for another project I'm working
on, I'm going to proceed with them for now.

Thoughts?

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org



More information about the Zope-Dev mailing list