Re: Supervising a pipeline?

2016-01-18 Thread Jonathan de Boyne Pollard
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 wi

Re: Supervising a pipeline?

2015-12-27 Thread Laurent Bercot
On 28/12/2015 00:45, Steve Litt wrote: In that case, what happens if I *also* need a log? Do I have a foobar/log/log directory? Nope, you only get one integrated pipe, not two. It's a *very* specific setup (and I've stopped being a fan of it since I've figured out how to do the same thing for

Re: Supervising a pipeline?

2015-12-27 Thread Steve Litt
On Sun, 27 Dec 2015 10:28:57 +0100 Laurent Bercot wrote: > On 2015-12-27 01:34, Steve Litt wrote: > > Congrats Laurent: You've suggested a kludge that the King of > > Kludges, Steve Litt, cannot abide by. > > Eh, it's not even a kludge. It's a real solution to your problem. > The foobar + fo

Re: Supervising a pipeline?

2015-12-27 Thread Laurent Bercot
On 2015-12-27 01:34, Steve Litt wrote: Congrats Laurent: You've suggested a kludge that the King of Kludges, Steve Litt, cannot abide by. Eh, it's not even a kludge. It's a real solution to your problem. The foobar + foobar/log mechanism from daemontools/runit/s6-svscan, (as well as the rundeu

Re: Supervising a pipeline?

2015-12-26 Thread Georgi Chorbadzhiyski
On 12/26/15 7:09 PM, Steve Litt wrote: > I'm making a thumb drive automounter using inotifywait piped into my > Python program, which detects the proper CREATES and DELETES and > automounts and autoumounts accordingly. > > Here's what I thought the run script would look like (runit dialect): > >

Re: Supervising a pipeline?

2015-12-26 Thread Steve Litt
On Sat, 26 Dec 2015 18:25:22 +0100 Laurent Bercot wrote: > 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 indepe

Re: Supervising a pipeline?

2015-12-26 Thread post-sysv
On 12/26/2015 12:09 PM, Steve Litt wrote: Is this doable in a way consistent with supervision suites? Pipelines can form practically indefinite graphs in scope owing to the nature of fds (modulo process control limitations and space constraints). You might be interested in pipexec, which expl

Re: Supervising a pipeline?

2015-12-26 Thread Laurent Bercot
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

Re: Supervising a pipeline?

2015-12-26 Thread fREW Schmidt
Two things: I'm not at a computer but I'm *pretty* sure exec foo | bar doesn't work right? But more importantly, if the python program dies, the inotifywatch will get a SIGPIPE when it writes and then almost assuredly crash itself. You could kill the python program and see. -- sent from a rotar

Supervising a pipeline?

2015-12-26 Thread Steve Litt
Hi all, I'm making a thumb drive automounter using inotifywait piped into my Python program, which detects the proper CREATES and DELETES and automounts and autoumounts accordingly. Here's what I thought the run script would look like (runit dialect): #!/bin/sh exec /usr/bin/inotifywait /dev/dis