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

Re: execute java jar file in a post-commit hook

From: Dave_Thomas mailing lists <davelist_at_peoplemerge.com>
Date: 2006-12-06 01:38:12 CET

I'd suspect one of the containing directories or perhaps the java binary not
having execute permissions.

try 'su apache -c ls -al /usr/local/java/bin'
or 'sudo apache ls -al /usr/local/java/bin'
Dave

On 12/5/06, kkrikor <krikor.krumlian@gmail.com> wrote:
>
>
> Well ,
>
> Actually that put the following in k.txt file
>
> /var/www/svnroot/hooks/post-commit: line 65: /usr/local/java/bin/java:
> Permission denied
>
> Now the permissions on /usr/local/java/bin/java is root:root with read
> write
> execute for all users. (777)
> and since i am using apache to do the commit the user it is coming in as
> is
> apache.
>
> I actually switched to user apache earlier and tried this from the command
> line and that worked. So
> what might be the problem when the hook is executing?
>
>
> Thank you for you help
>
>
>
> Ryan Schmidt-15 wrote:
> >
> > On Dec 5, 2006, at 17:09, kkrikor wrote:
> >
> >> Ryan Schmidt-15 wrote:
> >>
> >>> On Dec 5, 2006, at 15:16, kkrikor wrote:
> >>>
> >>>> kkrikor wrote:
> >>>>
> >>>>> Does this work ? I placed the following code in post-commit
> >>>>> Code:
> >>>>>
> >>>>>
> >>>>> # Trigger a build everytime a commit happens
> >>>>> /usr/local/java/bin/java -jar
> >>>>> /home/x/triggerContBuild/target/triggerContBuild/trigger/
> >>>>> triggerContBuild.jar
> >>>>>
> >>>>> # Send an email everytime a commit happens
> >>>>> /var/www/svnroot/hooks/commit-email.pl --from x@x.com "$REPOS"
> >>>>> "$REV"
> >>>>> x@x.com
> >>>>>
> >>>>>
> >>>>>
> >>>>> When i execute this post-commit on the command the jar file runs ,
> >>>>> But when i do a commit i get the email but the java jar file
> >>>>> does not
> >>>>> run. Any thoughts?
> >>>>>
> >>>>> I am using Http for my commits, i know the http server runs as
> >>>>> apache
> >>>>> user. So i did a su to apache and tried to execute it on the
> >>>>> command line
> >>>>> that worked too. So what am i missing ?
> >>>>
> >>>> I did the following , I execute this from my post-commit script
> >>>>
> >>>> #!/bin/sh
> >>>>
> >>>> export JAVA_HOME=/usr/local/java/
> >>>> export PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/
> >>>> X11R6/bin
> >>>> JAVA=/usr/local/java/bin/java
> >>>>
> >>>> /usr/local/java/bin/java > k.txt
> >>>>
> >>>> The file does not get created as usual when i run the post-commit
> >>>> on the command line it works fine
> >>>
> >>> Tell it what directory to put the file into.
> >>>
> >>> /usr/local/java/bin/java > /complete/path/to/k.txt
> >>
> >> Yes i actually tried that already, It is creating the file now but
> >> it is
> >> empty
> >> Whereas if i execute this online i get the file but it has java
> >> help in it.
> >>
> >> It seems to me that java is just not executing for some reason.
> >
> > Maybe something's happening on stderr. Try:
> >
> > /usr/local/java/bin/java > /complete/path/to/k.txt 2>&1
> >
> >
> > --
> > To reply to the mailing list, please use your mailer's Reply To All
> > function
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/execute-java-jar-file-in-a-post-commit-hook-tf2764050.html#a7711229
> Sent from the Subversion Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
Received on Wed Dec 6 01:38:50 2006

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