Re: [Zope3-dev] Is there an alternative to zdaemon?

2006-12-23 Thread Dieter Maurer
Jim Fulton wrote at 2006-12-22 15:55 -0500:
 
Thoughts?

We are using zdaemon widely and would be sad to loose it.

The underdocumented argument is unjustified in my view:

  *  zdaemon comes with reasonable online documentation
 (the help command)

  *  like for all zconfig based programs, essential documentation
 can be found in the schema file.

 As the configuration options have been carefully documented
 (also quite common for zconfig based programs), this
 is sufficient documentation for the configuration.

  *  There are other forms of documentation than testable documentation
 (aka doctests).



-- 
Dieter
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



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

2006-12-22 Thread Jim Fulton

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:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Is there an alternative to zdaemon?

2006-12-22 Thread Sascha Ottolski
Am Freitag, 22. Dezember 2006 21:55 schrieb Jim Fulton:
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.

daeomontools are definetely worth looking, i use it for some years now, 
and never had problems. it wasn't updated in almost five years, since 
it just works.

you are right about the restart issue: if a supervised process dies, 
it's restarted, no matter why it died. what would an abnormal restart 
be, that should not take place, anyway? in the sense, how would the 
supervisor know thats it's abnormal?

FWIW, there's also runit, obviously developed in the same spirit but 
independend of daemontools: http://smarden.org/runit/useinit.html

And the python coded Supervisor2 made by Chris McDonough 
http://www.plope.com/software/supervisor2/

i myself have no experinces with these two, though.


Cheers, Sascha

-- 
Lalisio GmbH                                          www.lalisio.com

Puschkinstraße 1                             fon +49-(0)361/541 43 80
99084 Erfurt                                 fax +49-(0)361/541 43 79
                                                 [EMAIL PROTECTED]

+
AKTUELLER HINWEIS (November 2006)

Wussten Sie schon, dass Sie mit der Literatursuchmaschine von Lalisio
in mehr als 12 Millionen Titeln suchen und bei vielen Publikationen
sogar die Abstracts lesen können?

Testen Sie unser Angebot unter www.lalisio.com!
+
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Is there an alternative to zdaemon?

2006-12-22 Thread Jim Fulton

Sascha Ottolski wrote:

Am Freitag, 22. Dezember 2006 21:55 schrieb Jim Fulton:
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.


daeomontools are definetely worth looking, i use it for some years now, 
and never had problems. it wasn't updated in almost five years, since 
it just works.


you are right about the restart issue: if a supervised process dies, 
it's restarted, no matter why it died. what would an abnormal restart 
be, that should not take place, anyway? 


An abnormal exit is an exit due to some error, such as a segmentation
fault or running out of memory.

 in the sense, how would the

supervisor know thats it's abnormal?


It can check the exit status.  Normal shutdowns typycally exit with
status 0.  zdaemon (and supervisor2, which was obviously inspired by
zdaemon) has an exit-codes option to configure which exit codes
are normal.  If the supervisor exists with one of these exit codes,
it should not be restarted.

FWIW, there's also runit, obviously developed in the same spirit but 
independend of daemontools: http://smarden.org/runit/useinit.html


This wants to run as process 1.  This seems a bit intrusive.

And the python coded Supervisor2 made by Chris McDonough 
http://www.plope.com/software/supervisor2/


This is interesting.

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Is there an alternative to zdaemon?

2006-12-22 Thread Paul Winkler
On Fri, Dec 22, 2006 at 05:04:37PM -0500, Jim Fulton wrote:
 Sascha Ottolski wrote:
 And the python coded Supervisor2 made by Chris McDonough 
 http://www.plope.com/software/supervisor2/
 
 This is interesting.

We've been using supervisor (previous version) for all our zope
applications for a year or so. Works as advertised, pretty easy to set
up.

At my previous job, we used daemontools, which was OK, except we never
found a solution to the problem of I want to get email notifications
when the system is restarting unexpectedly, but I don't want my mail
to get a DOS attack when the system can't start successfully so it
keeps restarting forever.

-- 

Paul Winkler
http://www.slinkp.com
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Is there an alternative to zdaemon?

2006-12-22 Thread Sascha Ottolski
Am Freitag, 22. Dezember 2006 23:04 schrieb Jim Fulton:
 An abnormal exit is an exit due to some error, such as a segmentation
 fault or running out of memory.

   in the sense, how would the
 
  supervisor know thats it's abnormal?

 It can check the exit status.  Normal shutdowns typycally exit with
 status 0.  zdaemon (and supervisor2, which was obviously inspired by
 zdaemon) has an exit-codes option to configure which exit codes
 are normal.  If the supervisor exists with one of these exit codes,
 it should not be restarted.

i see. however, i guess the idea of a supervisor is just for such cases: to 
take care to restart a server that broke. there's svc -o to run a service 
only once, which comes handy if one is not sure if the server will survive 
a start. what i think to make more sense would be that the supervisor could 
detect if a server is restarted too frequently. in my experience, thats more 
often a situation that needs special attention.


  FWIW, there's also runit, obviously developed in the same spirit but
  independend of daemontools: http://smarden.org/runit/useinit.html

 This wants to run as process 1.  This seems a bit intrusive.

yes and no. the page i linked to explains how to use it while _not_ replacing 
init. in that mode it seems to be quite like daemontools (see The sv 
program, The runsvdir program, The runsvchdir program and The runsv 
program on the main runit page). i guess there is at least some support for 
your use case, see http://smarden.sunsite.dk/runit/runsv.8.html: one can 
define a finish script, which is started with the exit code of the 
supervised process as one of its parameters.


Cheers, Sascha

-- 
Lalisio GmbH                            www.lalisio.com

Puschkinstraße 1                   fon +49-(0)361/541 43 80
99084 Erfurt                       fax +49-(0)361/541 43 79
                                       [EMAIL PROTECTED]
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Is there an alternative to zdaemon?

2006-12-22 Thread Sascha Ottolski
Am Freitag, 22. Dezember 2006 23:23 schrieb Paul Winkler:
 On Fri, Dec 22, 2006 at 05:04:37PM -0500, Jim Fulton wrote:
  Sascha Ottolski wrote:
  And the python coded Supervisor2 made by Chris McDonough
  http://www.plope.com/software/supervisor2/
 
  This is interesting.

 We've been using supervisor (previous version) for all our zope
 applications for a year or so. Works as advertised, pretty easy to set
 up.

 At my previous job, we used daemontools, which was OK, except we never
 found a solution to the problem of I want to get email notifications
 when the system is restarting unexpectedly, but I don't want my mail
 to get a DOS attack when the system can't start successfully so it
 keeps restarting forever.

hmm, what about:

let the run script touch or write some status file; the very same script would 
send an email on a normal restart, but may stop to do so if the status file 
is to new. hmm, thinking further, the script could even delay or block the 
restart, if desired. i guess the run script could also be written in 
python.


Cheers, Sascha

-- 
Lalisio GmbH                            www.lalisio.com

Puschkinstraße 1                   fon +49-(0)361/541 43 80
99084 Erfurt                       fax +49-(0)361/541 43 79
                                       [EMAIL PROTECTED]
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Is there an alternative to zdaemon?

2006-12-22 Thread Jim Fulton

Sascha Ottolski wrote:

Am Freitag, 22. Dezember 2006 23:04 schrieb Jim Fulton:

An abnormal exit is an exit due to some error, such as a segmentation
fault or running out of memory.

  in the sense, how would the

supervisor know thats it's abnormal?

It can check the exit status.  Normal shutdowns typycally exit with
status 0.  zdaemon (and supervisor2, which was obviously inspired by
zdaemon) has an exit-codes option to configure which exit codes
are normal.  If the supervisor exists with one of these exit codes,
it should not be restarted.


i see. however, i guess the idea of a supervisor is just for such cases: to 
take care to restart a server that broke. there's svc -o to run a service 
only once, which comes handy if one is not sure if the server will survive 
a start.


Yes

what i think to make more sense would be that the supervisor could 
detect if a server is restarted too frequently. in my experience, thats more 
often a situation that needs special attention.


Yes, that's a case that zdaemon and supervistor2 handle.

Yu also want an application to be able to exit normally
without being restarted.

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Is there an alternative to zdaemon?

2006-12-22 Thread Paul Winkler
On Fri, Dec 22, 2006 at 11:38:33PM +0100, Sascha Ottolski wrote:
  At my previous job, we used daemontools, which was OK, except we never
  found a solution to the problem of I want to get email notifications
  when the system is restarting unexpectedly, but I don't want my mail
  to get a DOS attack when the system can't start successfully so it
  keeps restarting forever.
 
 hmm, what about:
 
 let the run script touch or write some status file; the very same script 
 would 
 send an email on a normal restart, but may stop to do so if the status file 
 is to new. hmm, thinking further, the script could even delay or block the 
 restart, if desired. i guess the run script could also be written in 
 python.

Sure, but it's such a common need that ideally I'd like that to be
taken care of for me :-)

supervisor normally gives up after some number of restart attempts,
which is fine with me.

-- 

Paul Winkler
http://www.slinkp.com
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com