"rapid cycling" by supervise
"Peter Wolfenden" <[email protected]>
| Newsgroups | gmane.comp.djb.syslog |
|---|---|
| Message-ID | <[email protected]> |
Hello,
In my experience, supervise does not behave as advertised:
supervise switches to the directory named s and starts ./run.
It restarts ./run if ./run exits. It pauses for a second after
starting ./run, so that it does not loop too quickly if ./run
exits immediately.
I have a perl program which runs as a service, and in the event
that there's a problem in Perl's "compilation" phase, the program
exits with an error and is restarted several times per second.
The service directory 's' is OK in this case and there is only
one copy of supervise running for this service, so the following
caveat does not apply:
supervise may exit immediately after startup if it cannot find
the files it needs in s or if another copy of supervise is already
running in s.
I avoid this "rapid cycling" problem today by doing what I can to
make sure that any program which is to be run as a service fails
"slowly" (by sleeping 5 seconds prior to exiting, for example).
Cheers,
Peter Wolfenden