Re: Emulate pipe-tools' finish script using daemontools?

Daryl Tester <[email protected]> Thu, 29 Jun 2006 11:42:52 +0930
Newsgroups gmane.comp.djb.syslog
Message-ID <[email protected]>
Jos Backus wrote:

...

> "Whenever ./run exits, npt-supervise tries and start ./finish if it exists.
> The exit code and exit status from ./run is given as arguments to ./finish."

> Then there's runit but while its runsvdir command supports a finished script,
> it doesn't seem to be passing the exit code and exit status as npt-supervise
> does.

I have a patch to supervise that does something similar.  From the comments
of the patch -

**  Run 'postrun' program (if it exists) after run program has completed.
**  postrun is passed 7 arguments, consisting of:
**     arg #1 - service directory
**     arg #2 - exit_type ("exit", "stopped", "signaled", "coredump")
**     arg #3 - exit_value (numeric exit code or signal, depending on above)
**     arg #4 - pid of ex-process
**     arg #5 - required state - ("up", "down", "")
**     arg #6 - supervise exiting ("exit", "")
**     arg #7 - process paused ("paused", "")

I haven't "released" it as such because it needs better documentation, but
it's been in production for a while now.  I can mail you a copy off list
if you're willing to be a guinea pig.  :-)

> So the question is: is there a way to emulate this behavior using daemontools?

Difficult, given the need to exec the final program into place in
the run script.


-- 
Regards,
  Daryl Tester, IOCANE Pty. Ltd.