On Fri, Oct 22, 2010 at 07:10:21AM -0700, GitHub wrote:
> ajdiaz wants someone to pull from ajdiaz:master:
>
> With these patches, btpd allows a --hook-script option, which receives any executable path. This file will be called when a leech start or stop and also when download is finished.
>
> The hook script will be called with two arguments, the first one is a character which indicates the action:
>
> 'S': Start
> 'T': Stop
> 'F': Finished
>
> And the second one is the torrent name. It's useful, for example, to display a desktop notification, or unpack the downloaded file or anything else.
>
>
> View Pull Request: http://github.com/btpd/btpd/pull/24
It may require some fiddling if you want to report the exit status,
you'll have to keep a list of outstanding children then cause the signal
handler to trigger an event to report the status. This is easy with
libevent but I don't know how easy with btpd's customised thing.
On Fri, Oct 22, 2010 at 08:09:39PM +0200, Andr�s J. D�az wrote:
>
> Yes, you are right, btpd process still blocking while script working, I
> my case it's not a problem (I use btpd to deploy applications, usually
> one tarball per hour), but it seems to be a problem in a lot of cases...
>
> I would try to exec the script in a child process (fork). It would be
> fine for you?
> --
> Regards,
> Andr�s J. D�az