On Tue, Oct 19, 2010 at 2:13 PM, Johan Corveleyn <jcorvel_at_gmail.com> wrote:
> On Tue, Oct 19, 2010 at 11:04 PM, Kylo Ginsberg <kylo_at_kylo.net> wrote:
>> Hi folks,
>>
>> I'm running 1.6.9 on Fedora 12. With this post-commit script:
>>
>> #!/bin/sh
>> REPOS="$1"
>> REV="$2"
>> $REPOS/hooks/delay.sh &
>>
>> and delay.sh is just:
>>
>> #!/bin/sh
>> sleep 5
>>
>> This causes commits to delay 5 seconds before completing at the
>> client. Running post-commit directly from the command-line it returns
>> immediately, so it is apparently something about how svn/apr invokes
>> the hook.
>>
>> The above is a simplification; what I am really trying to do is put
>> sync's to a proxy server in the background so that large commits
>> aren't blocked while we sync to proxy servers across a WAN.
>>
>> I assume this is not expected behavior. In fact the svnbook carefully
>> describes putting proxy syncs in the background, so I believe I'm
>> following best practices.
>
> I think you have to redirect stdout and stderr to a file (or to
> /dev/null if you wish). Something like:
>
> $REPOS/hooks/delay.sh 2>&1 >logfile &
>
> should do the trick.
>
> I do this with my post-commit hook as well (for sending out commit
> emails, don't want that to delay the commit), and it works perfectly.
>
> Cheers,
> --
> Johan
>
Perfect. Thanks!
Kylo
Received on 2010-10-19 23:16:44 CEST