#! /bin/sh /usr/share/dpatch/dpatch-run ## 02-javapathfix-useragent.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: No description. @DPATCH@ diff -urNad ourgrid-src-3.3.2~/bin/useragent ourgrid-src-3.3.2/bin/useragent --- ourgrid-src-3.3.2~/bin/useragent 2007-05-23 11:07:10.000000000 -0300 +++ ourgrid-src-3.3.2/bin/useragent 2007-05-23 11:14:18.000000000 -0300 @@ -61,6 +61,19 @@ fi } +# Set the JAVA_CMD to call the Java Virtual Machine +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +setjavacmd(){ + JAVA_CMD=/usr/lib/jvm/java-1.5.0-sun/bin/java + if [ -z "$JAVA_CMD" ]; then + echo "ERR_JAVA_NOT_FOUND" + return $ERR_JAVA_NOT_FOUND + else + return $OK + fi +} + + usage(){ if [ $# -eq 0 ]; then @@ -109,11 +122,11 @@ uacmdname="org.ourgrid.gridmachine.useragent.ui.CommandManager" if [ $INVOKED_BY_UAADMIN -eq 0 ]; then - java -Xmx1024m -cp $CLASSPATH $uacmdname $command & + $JAVA_CMD -Xmx1024m -cp $CLASSPATH $uacmdname $command & else # This is necessary for ssh not hang during uaadmin # execution - java -Xmx1024m -cp $CLASSPATH $uacmdname $command /dev/null 2>&1 & + $JAVA_CMD -Xmx1024m -cp $CLASSPATH $uacmdname $command /dev/null 2>&1 & fi sleep 2 @@ -170,7 +183,7 @@ [ "$COMMAND_NAME" = "stop" ] || [ "$COMMAND_NAME" = "status" ] || [ "$COMMAND_NAME" = "restart" ]; then - finduaroot + finduaroot && setjavacmd cd $UAROOT export CLASSPATH=".:useragent.jar:aspectjrt.jar:log4j.jar" ret=$?