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): > > #!/bin/sh > exec /usr/bin/inotifywait /dev/disk | /usr/local/bin/automounter.py > > However, it was pointed out to me that if automounter.py crashed, > inotifywait would keep spinning and shooting its voluminous stdout > messages into the ether. And presumably the service wouldn't crash and > restart. > > Is this doable in a way consistent with supervision suites? > > I completely understand that 95% of you think what I've suggested is a > no-style kludge that shouldn't be done, and that I should use Python's > inotify framework. This is a completely different discussion: I'm > limiting my question to whether such a pipeline is, or can be made, > consistent with things like daemontools-encore, s6, and runit.
I'm using rundeux from perp for exactly the same thing. http://b0llix.net/perp/site.cgi?page=rundeux.8 On side there is inotifywait process and on the other the script that processes the events. It works perfectly. -- Georgi Chorbadzhiyski | http://georgi.unixsol.org/ | http://github.com/gfto/
