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

Re: Hooks don't work via Http-Access

From: David Weintraub <qazwart_at_gmail.com>
Date: Fri, 12 Jun 2009 12:50:18 -0400

Okay, you use the file:/// protocol and the hooks work. Either you are
signing in as the wwwrun user, or you have read/write permissions on the
files in your repository. Since the files in your repository are 755, I take
it you are signing in as user "wwwrun"?

I normally just use http or svn and never file. But, I've never had an issue
with hook scripts not executing.

Are your hook scripts installed in the hooks folder inside of your
repository? Are the names of the hooks the names needed by Subversion? You
can't use suffixes on your hook names. Could there be an issue with your
PATH variable?

Are all files in your repository with the same read/write permission and
owner? I normally set all files in my repository to 755 owned by (in this
case) wwwrun:www and that takes care of any problems with hooks and access.

Normally, hooks just work. Try this: At the beginning of the hook script,
put an output to STDERR, and then exit immediately with a non-zero error
status. For example, in Perl:

#! /usr/bin/env perl

# Start of my hook script:

print STDERR "DEBUG: I am in my pre-commit hook script!\n";
exit (2);

This will help determine whether or not your hook script is actually
executing,

On Thu, Jun 11, 2009 at 9:55 AM, Wiebesiek, Torsten <
torsten.wiebesiek_at_grecon.de> wrote:

> > From: David Weintraub [mailto:qazwart_at_gmail.com]
> > Sent: Thursday, June 11, 2009 3:36 PM
> >
> > What protocol are you using in your example? When you do a
> > checkout, you normally have to use a URL and not just a file name...
>
> Well, I've checked it with file and http protocol. I used the file
> protocol for testing on the server, and the http protocol from the
> windows machines.
>
> > Your repository must be owned by the user who is acting as a
> > server. If you're using the http protocol, this will be the
> > user who is running Apache. (Normally "apache" on Redhat" and
> > "wwwrun" on SUSE).
>
> The apache runs as wwwrun, the repositories including the hook
> scripts belong to wwwrun:www, the permissions of the hooks are
> 755:
> > ls -l post-commit
> > -rwxr-xr-x 1 wwwrun www 489 Jun 11 09:02 post-commit
>
> > I am assuming you're running the file:// protocol, and maybe
> > the hook scripts are not owned or executable by the user
> > running Apache.
>
> The hooks are working on the server using the file protocol.
> From the windows client using urls, they don't. The rest of
> the subversion access works just fine. It's possible to check
> out, commit changes, and so on.
>
> I have no idea, why the hooks work, using the file protocol on
> the server, and they don't from the windows clients using urls.
>
> :-(
>
>
> > On Thu, Jun 11, 2009 at 7:05 AM, Wiebesiek, Torsten
> > <torsten.wiebesiek_at_grecon.de> wrote:
> >
> >
> > Hi,
> >
> > I've just setup our subversion repositories on a Linux
> > machine. For each repsitory, there exists a post-commit
> > hook. Accessing the repositories from the Linux machine
> > via
> > > svn co /srv/svn/repositories/Playground Playground
> > > svn commit
> > works perfectly well, including the hooks.
> >
> > Unfortunately, it's not working from our developer's
> > windows machines. I've tried tortoise as well as the
> > command line client. Check out, update, commit all
> > works perfectly, but the hooks are not carried out.
> >
> > To access the repositories, I've setup a virtual host
> > on the apache, that also serves our internal wiki.
> > I've removed all group authentication mechanism and
> > tries simplified hooks and a simplified virtual host
> > configration (see below). The server is running as
> > wwwrun:www and the hook as 755 permissions.
> >
> > Has anyone an idea, what I am doing wrong?
> >
> > Thanks, Torsten
> >
> >
> > Software versions:
> > Subversion on server and client 1.6.2
> > Tortoise on client 1.6.2
> > Apache on server 2.2.9
> >
> >
> > Here is my simple post-commit hook for testing purpose
> > (permissions 755):
> >
> > > #!/bin/sh
> > >
> > > REPOS="$1"
> > > REV="$2"
> > >
> > > echo `/bin/date +"%Y-%m-%d %k:%M:%S"` : repository=$REPOS
> > revision=$REV >> /tmp/svn.log
> >
> >
> > And here is my apache virtual host configuration:
> >
> > > <VirtualHost *:80>
> > >
> > > ServerName svn.local
> > >
> > > <Location />
> > >
> > > Dav svn
> > >
> > > SVNParentPath /srv/svn/repositories
> > >
> > > AuthType Basic
> > > AuthUserFile /srv/svn/conf/passwd
> > >
> > > Order deny,allow
> > > Deny from all
> > > Allow from 172.16.0.0/16
> > > Satisfy all
> > >
> > > </Location>
> > >
> > > </VirtualHost>
>
> ------------------------------------------------------
>
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2361291
>
> To unsubscribe from this discussion, e-mail: [
> users-unsubscribe_at_subversion.tigris.org].
>

-- 
David Weintraub
qazwart_at_gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2361684
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-06-12 18:51:12 CEST

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