summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors00370346 <swarup.nayak1@huawei.com>2019-05-30 17:33:40 +0530
committers00370346 <swarup.nayak1@huawei.com>2019-05-30 17:33:40 +0530
commit12a725008d66a63bcc94aa97c55e2bc72e733a95 (patch)
tree54ea20e91901e8f96c9f987e1e7b08895a491240
parent45762e8d8a1555957c99f9c8dd995e8542f5d5c3 (diff)
Issue-ID: DCAEGEN2-1545 RestconfCollector Jenkins Job failing
Signed-off-by: s00370346 <swarup.nayak1@huawei.com> Change-Id: Ide5ce628514709f9dda3ae884a51c56f75f1d0a0
-rwxr-xr-xsrc/main/scripts/restConfCollector.sh13
1 files 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!!!"