You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2018/11/01 09:25:50 UTC

ignite git commit: IGNITE-7926 Web Console agent: Fixed incorrect classpath - Fixes #5221.

Repository: ignite
Updated Branches:
  refs/heads/master 035a027b2 -> 6f9c702cd


IGNITE-7926 Web Console agent: Fixed incorrect classpath - Fixes #5221.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6f9c702c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6f9c702c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6f9c702c

Branch: refs/heads/master
Commit: 6f9c702cd764963208c8962d7ef35b2c340dbc08
Parents: 035a027
Author: Andrey Novikov <an...@gridgain.com>
Authored: Thu Nov 1 16:25:10 2018 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Thu Nov 1 16:25:10 2018 +0700

----------------------------------------------------------------------
 .../web-agent/bin/ignite-web-agent.sh           | 38 +++++++++-----------
 1 file changed, 17 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/6f9c702c/modules/web-console/web-agent/bin/ignite-web-agent.sh
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/bin/ignite-web-agent.sh b/modules/web-console/web-agent/bin/ignite-web-agent.sh
index 3a649e3..74a8bf5 100755
--- a/modules/web-console/web-agent/bin/ignite-web-agent.sh
+++ b/modules/web-console/web-agent/bin/ignite-web-agent.sh
@@ -16,34 +16,30 @@
 # limitations under the License.
 #
 
-SOURCE=$(dirname "$0")
-
-source "${SOURCE}"/include/functions.sh
-
-#
-# Discover path to Java executable and check it's version.
-#
-checkJava
-
-#
-# Set IGNITE_HOME.
-#
-export IGNITE_HOME="$(dirname "$(cd "$(dirname "$0")"; "pwd")")";
-
-DIR="$( dirname "$SOURCE" )"
+SOURCE="${BASH_SOURCE[0]}"
 
+# Resolve $SOURCE until the file is no longer a symlink.
 while [ -h "$SOURCE" ]
     do
-        SOURCE="$(readlink "$SOURCE")"
+        IGNITE_HOME="$(cd -P "$( dirname "$SOURCE"  )" && pwd)"
 
-        [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
+        SOURCE="$(readlink "$SOURCE")"
 
-        DIR="$( cd -P "$( dirname "$SOURCE"  )" && pwd )"
+        # If $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located.
+        [[ $SOURCE != /* ]] && SOURCE="$IGNITE_HOME/$SOURCE"
     done
 
-DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+#
+# Set IGNITE_HOME.
+#
+export IGNITE_HOME="$(cd -P "$( dirname "$SOURCE" )" && pwd)"
+
+source "${IGNITE_HOME}"/include/functions.sh
 
-cd $DIR
+#
+# Discover path to Java executable and check it's version.
+#
+checkJava
 
 #
 # JVM options. See http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp for more details.
@@ -94,4 +90,4 @@ elif [ $version -eq 11 ] ; then
         ${JVM_OPTS}"
 fi
 
-"$JAVA" ${JVM_OPTS} -cp "*" org.apache.ignite.console.agent.AgentLauncher "$@"
+"$JAVA" ${JVM_OPTS} -cp "${IGNITE_HOME}/*" org.apache.ignite.console.agent.AgentLauncher "$@"