Laurent Bercot:

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.)


Actually, the syntax for nosh can be exactly as described: something/run and something/log/run . It's not ideal, because of course then there's no properly separated logging of the automounter.


Laurent Bercot:

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).


Yes: The nosh toolkit makes this extensible. The aforegiven configuration is enacted by the daemontools service scanner. The underlying service management supports arbitrarily long pipelines of services, each one's standard output and standard error feeding into the standard input of the next one along. The system-control utility looks at the "log" symbolic links of whatever collection of services it is operating upon and sends a "plumb services together" order to the service manager. So one could construct a 3-service long pipeline: inotifywait into Python program into cyclog instance.


Reply via email to