Re: Supervising a pipeline?

From: Laurent Bercot <ska-supervision_at_skarnet.org>
Date: Sat, 26 Dec 2015 18:25:22 +0100

On 2015-12-26 18:09, Steve Litt wrote:
> #!/bin/sh
> exec /usr/bin/inotifywait /dev/disk | /usr/local/bin/automounter.py

  You can't supervise a pipeline per se; you need to supervise
both processes in the pipeline independently, and make sure the pipe
isn't broken when one of them dies.

  So, have "exec inotifywait /dev/disk" as foobar/run, and have
"exec automounter.py" as foobar/log/run. This will work with daemontools,
runit and s6. (You can accomplish the same goal with perp and nosh too;
the syntax will just be different.)

  Alternatively, you could use s6-rc and create the "inotifywait" and
"automounter" longrun services in a pipeline; your compiled database
would then include instructions to set up the supervised pipeline
for you. This is more complex to set up than just using the integrated
pipe management in svscan and runsvdir, but it's also more powerful,
because you can pipeline an arbitrary number of processes that way
(this is also what nosh does).

-- 
  Laurent
Received on Sat Dec 26 2015 - 17:25:22 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC