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

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

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

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

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

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