On Feb 9, 2007, at 4:25 PM, Doug Goldstein wrote:
> Erik Hemdal wrote:
>>> Erik Hemdal wrote:
>>>>> Ryan Schmidt wrote:
>>>>>> On Feb 9, 2007, at 12:25, Doug Goldstein wrote:
>>> . . .
>>>> Any possibility that another user, like 'svn' or 'apache' or
>>>> 'whatever' is actually running the script and not the user you
>>>> are testing with? Maybe setting world-execute would help?
>>> # ls -l /var/data/svn/project/hooks/pre-commit
>>> -rwxr-xr-x 1 root svnusers 796 Feb 9 13:10 /var/data/svn/project/
>> OK, the only other thing I can suggest is to verify you have execute
>> permission on all the higher-level directories to the hook
>> script. If you
>> don't have it, you can't pass through to find the script so you
>> can run it.
> doug@doug ~ $ ssh doug@gravel
> Last login: Fri Feb 9 16:22:19 2007 from doug.
> doug@gravel ~ $ /var/data/svn/project/hooks/pre-commit
> doug@gravel ~ $ echo $?
> doug@gravel ~ $ groups
> users svnusers
> Since I am using svn+ssh://, my commits should be running as my
> user, "doug". So svnserve will be running as that user.
> You can see the script is owned by the svnusers group, which I also
> am a part of. If the directories below did not have the execute
> bit, I would not be able to execute this file.
I think you already know that -
- the environment that the hook script runs in is empty (there's
no PATH defined)
- the hook script may not run as the user you expect
I usually use brute force to debug hook scripts -
- define a log file
- for selected/every command 'cmd' in the hook script redirect all
output to the log file
- put messages in the log file with echo
so the hook script might contain debugging code like this -
/usr/bin/whoami >> $LOG 2>&1
/bin/echo "about to execute cmd" >> $LOG 2>&1
cmd >> $LOG 2>&1
/bin/echo "finished cmd" >> $LOG 2>&1
Then on the server
$ tail -f /tmp/hook.log
Then on the client commit something
When debugging I'm always surprised by what I see/don't see in the
log file :-)
Hope this helps.
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Fri Feb 9 22:43:51 2007