From 12a725008d66a63bcc94aa97c55e2bc72e733a95 Mon Sep 17 00:00:00 2001 From: s00370346 Date: Thu, 30 May 2019 17:33:40 +0530 Subject: Issue-ID: DCAEGEN2-1545 RestconfCollector Jenkins Job failing Signed-off-by: s00370346 Change-Id: Ide5ce628514709f9dda3ae884a51c56f75f1d0a0 --- src/main/scripts/restConfCollector.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/scripts/restConfCollector.sh b/src/main/scripts/restConfCollector.sh index 9a211fd..cbf9fa7 100755 --- a/src/main/scripts/restConfCollector.sh +++ b/src/main/scripts/restConfCollector.sh @@ -32,7 +32,7 @@ cd - restConfCollector_start() { echo `date +"%Y%m%d.%H%M%S%3N"` - restConfCollector_start | tee -a ${BASEDIR}/logs/console.txt - collectorPid=`pgrep -f org.onap.restconf.common` + collectorPid=`pidof java` if [ ! -z "$collectorPid" ]; then echo "WARNING: restConf Collector already running as PID $collectorPid" | tee -a ${BASEDIR}/logs/console.txt @@ -50,12 +50,8 @@ restConfCollector_start() { if [ $? -ne 0 ]; then echo "restConf Collector has been started!!!" | tee -a ${BASEDIR}/logs/console.txt fi - - } -## Pre-setting -JAVA_HOME=/usr/bin/java # use JAVA_HOME if provided if [ -z "$JAVA_HOME" ]; then @@ -63,7 +59,8 @@ if [ -z "$JAVA_HOME" ]; then echo "Startup Aborted!!" exit 1 else - JAVA=$JAVA_HOME + echo "$JAVA_HOME" + JAVA=$JAVA_HOME/bin/java fi MAINCLASS=org.onap.dcae.RestConfCollector @@ -88,13 +85,13 @@ esac restConfCollector_stop() { echo `date +"%Y%m%d.%H%M%S%3N"` - collector_stop - collectorPid=`pgrep -f org.onap.dcae.collectors.restconf.common` + collectorPid=`pidof java` if [ ! -z "$collectorPid" ]; then echo "Stopping PID $collectorPid" kill -9 $collectorPid sleep 5 - if [ ! "$(pgrep -f org.onap.restconf.common)" ]; then + if [ ! $(pidof java) ]; then echo "restConf Collector has been stopped!!!" else echo "restConf Collector is being stopped!!!" -- cgit 1.2.3-korg