You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Steven Van Ingelgem <st...@vaningelgem.be> on 2009/01/25 07:35:05 UTC

[SVN - post-commit hook] hook failed, did not exit cleanly

Hi all,


I am trying to create a post-commit hook script for Subversion, but I always
keep on getting this error:

 Quote:
  'post-commit' hook failed (did not exit cleanly: apr_exit_why_e was 2,
exitcode was 10). with no output.
What I did was create a file "post-commit" in the repository under the
hooks/ directory.
 Quote:
  root@noname:/data/svn/testing/hooks# ls -lA post-commit
-rwxr-xr-x 1 _www _www 31 Jan 21 09:09 post-commit
Quote:
  root@noname:/data/svn/testing# ls -lAd hooks/
drwxr-xr-x 12 _www _www 408 Jan 21 09:09 hooks/
Quote:
  root@noname:/data/svn# ls -lAd testing/
drwxr-xr-x 9 _www _www 306 Jan 20 23:12 testing/
Quote:
  root@noname:/data# ls -lAd svn/
drwx------ 74 _www _www 2516 Jan 21 00:14 svn/
Quote:
  root@noname:/# ls -lAd data/
drwxr-xr-x 15 steven staff 510 Jan 17 16:12 data/

As you can see from the directory listings here above, the directory is
readable/writable by the www:www user. Under which the apache user runs, and
under which dav_svn was configured.

Subversion itself works perfectly, just not the post-commit hook.
 Quote:
  root@noname:/data/svn/testing/hooks# cat post-commit
#!/bin/sh

echo "Hello world";

As you can see, nothing fancy happens here...



I went already to search a little, and found out that "apr_exit_why_e"=2
means it's killed by signal. But why? I mean, the www user has complete
rights to the script, it's executable etc etc...


Can someone tell me what I am missing here?


Thanks a lot!
Steven

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

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

Re: [SVN - post-commit hook] hook failed, did not exit cleanly

Posted by Steven Van Ingelgem <st...@vaningelgem.be>.
That's what I did:

root@noname:~# chsh -s /bin/bash _www
Changing shell for _www.
root@noname:~# su - www
_www@noname:~$ cd /data/svn/testing/hooks/
_www@noname:/data/svn/testing/hooks$ env - ./post-commit /data/svn/testing
20
Hello world (on stdin)!
On Cerr
root@noname:~# chsh -s /usr/bin/false _www
Changing shell for _www.


I changed the post-commit now to:
root@noname:/tmp/tst# cat a.c
#include <stdio.h>

int main( )
{
        fprintf( stdout, "Hello world (on stdin)!\n" );
        fprintf( stderr, "On Cerr\n" );

        return 1;
}


This way I am sure there are no dependencies...


Everything is working with the www-user, (ran via dav_svn). But when I do a
commit, I always receive that error...


Greetings,
Steven


2009/1/26 Hari Kodungallur <hk...@gmail.com>

>
> On Mon, Jan 26, 2009 at 1:45 AM, Steven Van Ingelgem <
> steven@vaningelgem.be> wrote:
>
>>
>> Hi all,
>>
>>
>> I am trying to create a post-commit hook script for Subversion, but I
>> always keep on getting this error:
>>
>>  Quote:
>>   'post-commit' hook failed (did not exit cleanly: apr_exit_why_e was 2,
>> exitcode was 10). with no output.
>> What I did was create a file "post-commit" in the repository under the
>> hooks/ directory.
>>  Quote:
>>   root@noname:/data/svn/testing/hooks# ls -lA post-commit
>> -rwxr-xr-x 1 _www _www 31 Jan 21 09:09 post-commit
>> Quote:
>>   root@noname:/data/svn/testing# ls -lAd hooks/
>> drwxr-xr-x 12 _www _www 408 Jan 21 09:09 hooks/
>> Quote:
>>   root@noname:/data/svn# ls -lAd testing/
>> drwxr-xr-x 9 _www _www 306 Jan 20 23:12 testing/
>> Quote:
>>   root@noname:/data# ls -lAd svn/
>> drwx------ 74 _www _www 2516 Jan 21 00:14 svn/
>> Quote:
>>   root@noname:/# ls -lAd data/
>> drwxr-xr-x 15 steven staff 510 Jan 17 16:12 data/
>>
>> As you can see from the directory listings here above, the directory is
>> readable/writable by the www:www user. Under which the apache user runs, and
>> under which dav_svn was configured.
>>
>> Subversion itself works perfectly, just not the post-commit hook.
>>  Quote:
>>   root@noname:/data/svn/testing/hooks# cat post-commit
>> #!/bin/sh
>>
>> echo "Hello world";
>>
>> As you can see, nothing fancy happens here...
>>
>>
>>
>> I went already to search a little, and found out that "apr_exit_why_e"=2
>> means it's killed by signal. But why? I mean, the www user has complete
>> rights to the script, it's executable etc etc...
>>
>>
>> Can someone tell me what I am missing here?
>>
>
>
> Did you try debugging it as per
> http://subversion.tigris.org/faq.html#hook-debugging?
>
> regards,
> -Hari
>
>

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

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

Re: [SVN - post-commit hook] hook failed, did not exit cleanly

Posted by Hari Kodungallur <hk...@gmail.com>.
On Mon, Jan 26, 2009 at 1:45 AM, Steven Van Ingelgem
<st...@vaningelgem.be>wrote:

>
> Hi all,
>
>
> I am trying to create a post-commit hook script for Subversion, but I
> always keep on getting this error:
>
>  Quote:
>   'post-commit' hook failed (did not exit cleanly: apr_exit_why_e was 2,
> exitcode was 10). with no output.
> What I did was create a file "post-commit" in the repository under the
> hooks/ directory.
>  Quote:
>   root@noname:/data/svn/testing/hooks# ls -lA post-commit
> -rwxr-xr-x 1 _www _www 31 Jan 21 09:09 post-commit
> Quote:
>   root@noname:/data/svn/testing# ls -lAd hooks/
> drwxr-xr-x 12 _www _www 408 Jan 21 09:09 hooks/
> Quote:
>   root@noname:/data/svn# ls -lAd testing/
> drwxr-xr-x 9 _www _www 306 Jan 20 23:12 testing/
> Quote:
>   root@noname:/data# ls -lAd svn/
> drwx------ 74 _www _www 2516 Jan 21 00:14 svn/
> Quote:
>   root@noname:/# ls -lAd data/
> drwxr-xr-x 15 steven staff 510 Jan 17 16:12 data/
>
> As you can see from the directory listings here above, the directory is
> readable/writable by the www:www user. Under which the apache user runs, and
> under which dav_svn was configured.
>
> Subversion itself works perfectly, just not the post-commit hook.
>  Quote:
>   root@noname:/data/svn/testing/hooks# cat post-commit
> #!/bin/sh
>
> echo "Hello world";
>
> As you can see, nothing fancy happens here...
>
>
>
> I went already to search a little, and found out that "apr_exit_why_e"=2
> means it's killed by signal. But why? I mean, the www user has complete
> rights to the script, it's executable etc etc...
>
>
> Can someone tell me what I am missing here?
>


Did you try debugging it as per
http://subversion.tigris.org/faq.html#hook-debugging?

regards,
-Hari

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

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

[SVN - post-commit hook] hook failed, did not exit cleanly

Posted by Steven Van Ingelgem <st...@vaningelgem.be>.
Hi all,


I am trying to create a post-commit hook script for Subversion, but I always
keep on getting this error:

 Quote:
  'post-commit' hook failed (did not exit cleanly: apr_exit_why_e was 2,
exitcode was 10). with no output.
What I did was create a file "post-commit" in the repository under the
hooks/ directory.
 Quote:
  root@noname:/data/svn/testing/hooks# ls -lA post-commit
-rwxr-xr-x 1 _www _www 31 Jan 21 09:09 post-commit
Quote:
  root@noname:/data/svn/testing# ls -lAd hooks/
drwxr-xr-x 12 _www _www 408 Jan 21 09:09 hooks/
Quote:
  root@noname:/data/svn# ls -lAd testing/
drwxr-xr-x 9 _www _www 306 Jan 20 23:12 testing/
Quote:
  root@noname:/data# ls -lAd svn/
drwx------ 74 _www _www 2516 Jan 21 00:14 svn/
Quote:
  root@noname:/# ls -lAd data/
drwxr-xr-x 15 steven staff 510 Jan 17 16:12 data/

As you can see from the directory listings here above, the directory is
readable/writable by the www:www user. Under which the apache user runs, and
under which dav_svn was configured.

Subversion itself works perfectly, just not the post-commit hook.
 Quote:
  root@noname:/data/svn/testing/hooks# cat post-commit
#!/bin/sh

echo "Hello world";

As you can see, nothing fancy happens here...



I went already to search a little, and found out that "apr_exit_why_e"=2
means it's killed by signal. But why? I mean, the www user has complete
rights to the script, it's executable etc etc...


Can someone tell me what I am missing here?


Thanks a lot!
Steven

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

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