[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Post-commit hook problem

From: David SANCHEZ <david.sanchez_at_iutbeziers.fr>
Date: Fri, 23 Jan 2009 11:39:54 +0100

Konstantin Kolinko :
> 2009/1/23 David SANCHEZ <david.sanchez_at_iutbeziers.fr>:
>
>> Konstantin Kolinko :
>>
>> 2009/1/22 David SANCHEZ <david.sanchez_at_iutbeziers.fr>:
>>
>>
>> Hi,
>>
>> I'm working on a post-commit hook script, but I have a problem.
>>
>> To resume the script, it takes the filename of the last commit, and send
>> it to an other script, who will make a scp transfer to an appliance.
>>
>> But when I make the commit with the client, I have this message :
>>
>> user_at_computer_client:~/depot_local/red_interne$ svn commit -m "test 5"
>> Envoi fichier1
>> Transmission des données .
>> Révision 80 propagée.
>> Attention : post-commit hook failed (exit code 126) with output:
>> [Error output could not be translated from the native locale to UTF-8.]
>>
>> This is the post-commit script :
>>
>> #!/bin/sh
>> LANG="en_US.UTF-8"
>> REPOS='/var/subversion/red_interne'
>> SVNLOOK="/usr/bin/svnlook diff $REPOS"
>> GREP="/bin/grep -Eo \"Modified:.*$\""
>> SED="/bin/sed 's/Modified:\ //'"
>> FICHIER="$SVNLOOK | $GREP | $SED"
>> RESULTAT=`eval $FICHIER`
>> /usr/bin/ssh projet_at_localhost
>> /var/subversion/red_interne/hooks/script.sh $RESULTAT
>>
>> Thanks for any help
>>
>>
>>
>>
>>
>> Attention : post-commit hook failed (exit code 126) with output: (...)
>>
>>
>> POSIX specifies that exit code 126 in a standard shell means that
>> a command name is found, but it is not an executable utility.
>>
>> Check, whether the the user running the postcommit hook has
>> execute rights on the script.sh script or any script files called
>> by it.
>>
>> Best regards,
>> Konstantin Kolinko
>>
>>
>> My post-commit hook and the script executed by it have the good rights :
>> -rwxr--r-- 1 svn svn 695 jan 22 10:48 script.sh
>> -rwxr--r-- 1 svn svn 1420 jan 22 14:36 post-commit
>>
>> Or maybe the post-commit hook can't execute the ssh command, but it's
>> strange because /usr/bin/ssh is rxwr-xr-x
>>
>>
>
> 1. Note, that your reply did not went to the list. You had to hit
> "Reply All" when replying.
>
> 2. You did say nothing about the protocol (http(s) / svn / svn+ssh / file)
> that you are using to access the server. Required access rights do differ
> between protocols.
>
> Try 754 instead of 744 on those scripts. IIRC, that is what is required
> for svn:// access.
>
> Something should be written in the SVN Book, look there.
> http://svnbook.red-bean.com/en/1.5/index.html
>
> I do not have personal experience with svn on Linux yet, so maybe I
> won't be able to help much.
>
>
> 3. Any of commands in your script files can throw that error.
>
> Try to find, what one of them fails.
>
> Try adding
> set -x
> command to the scripts
>
>
> Best regards,
> Konstantin Kolinko
>
I use the file protocol, for the moment I make local tests.
I changed the rights, but the error message is the same.
For the book I read it, but the post-commit hook part is very short :(
And I tested every commands, they works.
I will test with the -x command when I have a little moment to test.

Regards,
David Sanchez

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1044624

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].

Received on 2009-01-23 16:55:33 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.