From 7343bfa20bf1eefc9eb5f85e2ceb55dfbad98e77 Mon Sep 17 00:00:00 2001 From: Jian Li Date: Wed, 27 Jan 2016 15:42:05 -0800 Subject: [PATCH] [ONOS-3553] Resolve the onos-service not start issue This commit resolves onos-service not start issue. If we have onos directory under /opt, no matter the directory is empty or not, onos-service always tries to use this path. If onos-service binary located in other path, we need to reconfigure the ONOS_HOME. Change-Id: I13f375d75e864240e6d014100fb7b69de7fd4178 --- tools/package/bin/onos-service | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/package/bin/onos-service b/tools/package/bin/onos-service index 2f00ca02bb..5cc20093ca 100755 --- a/tools/package/bin/onos-service +++ b/tools/package/bin/onos-service @@ -13,6 +13,15 @@ ONOS_HOME=/opt/onos KARAF_ARGS= SYS_APPS=drivers +CURRENT_ONOS_HOME="`( cd $(dirname $0)/.. && pwd )`" + +# check whether executable onos binary is located under /opt/onos +# if not try to reconfigure ONOS_HOME with current path +if [ $CURRENT_ONOS_HOME != $ONOS_HOME ]; then + ONOS_HOME=$CURRENT_ONOS_HOME +fi + +echo $ONOS_HOME [ -d $ONOS_HOME ] && cd $ONOS_HOME || ONOS_HOME=$(dirname $0)/..