Mercurial > hg > heapstats
changeset 252:6fd99b983c37
Bug 3464: Fix launcher and attacher to use on Ubuntu
Reviewed-by: yasuenag
https://github.com/HeapStats/heapstats/pull/124
author | KUBOTA Yuji <kubota.yuji@lab.ntt.co.jp> |
---|---|
date | Tue, 10 Oct 2017 23:39:34 +0900 |
parents | 65f74fefdd2c |
children | 1885f234b75b |
files | ChangeLog agent/attacher/heapstats-attacher.in analyzer/cli/heapstats-cli.in analyzer/fx/heapstats-analyzer.in |
diffstat | 4 files changed, 31 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Sep 26 17:09:37 2017 +0900 +++ b/ChangeLog Tue Oct 10 23:39:34 2017 +0900 @@ -1,3 +1,7 @@ +2017-10-10 KUBOTA Yuji <kubota.yuji@lab.ntt.co.jp> + + * Bug 3464: Fix launcher and attacher to use on Ubuntu + 2017-09-26 Yasumasa Suenaga <yasuenag@gmail.com> * Bug 3454: mvn reports exception w/ Java 9
--- a/agent/attacher/heapstats-attacher.in Tue Sep 26 17:09:37 2017 +0900 +++ b/agent/attacher/heapstats-attacher.in Tue Oct 10 23:39:34 2017 +0900 @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/bash #### Default values @@ -65,8 +65,12 @@ # Check attacher. if test ! -f "$ATTACHER_PATH" ; then - echo "Attacher not found." - exit 2 + echo "Attacher not found at $libexecdir, try to find heapstats-attacher.jar instead" + ATTACHER_PATH=$(find . -name "heapstats-attacher.jar" | head -n 1) + if test ! -f "$ATTACHER_PATH" ; then + echo "Attacher not found." + exit 2 + fi fi # Check tools.jar
--- a/analyzer/cli/heapstats-cli.in Tue Sep 26 17:09:37 2017 +0900 +++ b/analyzer/cli/heapstats-cli.in Tue Oct 10 23:39:34 2017 +0900 @@ -1,10 +1,19 @@ -#!/bin/sh +#!/bin/bash prefix=@prefix@ exec_prefix=@exec_prefix@ libexecdir=@libexecdir@ CLI_JAR="$libexecdir/heapstats-cli.jar" +# Check CLI. +if test ! -f "$CLI_JAR" ; then + echo "CLI not found at $libexecdir, try to find heapstats-cli.jar instead" + CLI_JAR=$(find . -name "heapstats-cli.jar" | head -n 1) + if test ! -f "$CLI_JAR" ; then + echo "CLI not found" + exit 2 + fi +fi if test -x $JAVA_HOME/bin/java; then $JAVA_HOME/bin/java $JAVA_OPTS -jar $CLI_JAR $@
--- a/analyzer/fx/heapstats-analyzer.in Tue Sep 26 17:09:37 2017 +0900 +++ b/analyzer/fx/heapstats-analyzer.in Tue Oct 10 23:39:34 2017 +0900 @@ -1,10 +1,19 @@ -#!/bin/sh +#!/bin/bash prefix=@prefix@ exec_prefix=@exec_prefix@ libexecdir=@libexecdir@ ANALYZER_JAR="$libexecdir/heapstats-analyzer.jar" +# Check Analyzer +if test ! -f "$ANALYZER_JAR" ; then + echo "Analyzer not found at $libexecdir, try to find heapstats-analyzer.jar instead" + ANALYZER_JAR=$(find . -name "heapstats-analyzer.jar" | head -n 1) + if test ! -f "$ANALYZER_JAR" ; then + echo "Analyzer not found" + exit 2 + fi +fi if test -x $JAVA_HOME/bin/java; then $JAVA_HOME/bin/java $JAVA_OPTS -jar $ANALYZER_JAR $@