X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=dmaap-bc%2Fmisc%2Fdmaapbc;h=51aa93a89421a495397b2c32116bb0088313fbfe;hb=9162456b7e6858e7cde3443b00cca05a20113233;hp=76317d86999b85b75a817aa1d6c50bf6e6e717f1;hpb=aa3cc0e7cd53265e8c82b56caf2f409ed5612e80;p=dmaap%2Fbuscontroller.git diff --git a/dmaap-bc/misc/dmaapbc b/dmaap-bc/misc/dmaapbc index 76317d8..51aa93a 100644 --- a/dmaap-bc/misc/dmaapbc +++ b/dmaap-bc/misc/dmaapbc @@ -25,9 +25,11 @@ umask 0022 TZ=GMT0 COMPONENT=dmaapbc APP_ROOT=/opt/app/$COMPONENT -USER=root +USER=dbc +GROUP=onap export TZ -PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/java/jdk/jdk180/bin +PATH=/usr/local/openjdk-11/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + export PATH CLASSPATH=`echo $APP_ROOT/etc $APP_ROOT/lib/*.jar | tr ' ' ':'` export CLASSPATH @@ -36,7 +38,22 @@ CONFIGMAP_PROPS=${CONFIGMAP_PROPS:-$CONFIGMAP_ROOT/conf/dmaapbc.properties} CONTAINER_CONFIG=$CONFIGMAP_ROOT/conf/buscontroller.env MAIN=org.onap.dmaap.dbcapi.server.Main - +authcheck() { + set -x + ID=`id -n -u` + GRP=`id -n -g` + if [ "$ID" != "$USER" ] + then + echo $COMPONENT must be started as user $USER not $ID + exit 1 + fi + if [ "$GRP" != "$GROUP" ] + then + echo $COMPONENT must be started as group $GROUP not $GRP + exit 1 + fi + set +x +} pids() { set -x @@ -70,12 +87,6 @@ config() { echo "Not creating $APP_ROOT/ok_to_exit" fi - if [ ! -f $APP_ROOT/misc/cert-client-init.sh ] - then - echo "Did not find $APP_ROOT/misc/cert-client-init.sh to append to truststore" - exit 1 - fi - $APP_ROOT/misc/cert-client-init.sh . misc/havecert.tmpl > etc/havecert chmod +x etc/havecert @@ -98,18 +109,7 @@ config() { start() { echo "ENTER start" set -x - ID=`id -n -u` - GRP=`id -n -g` - if [ "$ID" != "$USER" ] - then - echo $COMPONENT must be started as user $USER not $ID - exit 1 - fi - if [ "$GRP" != "$USER" ] - then - echo $COMPONENT must be started as group $USER not $GRP - exit 1 - fi + authcheck cd $APP_ROOT pwd @@ -140,18 +140,7 @@ start() { stop() { echo "ENTER stop" - ID=`id -n -u` - GRP=`id -n -g` - if [ "$ID" != "$USER" ] - then - echo $COMPONENT must be stopped as user $USER not $ID - exit 1 - fi - if [ "$GRP" != "$USER" ] - then - echo $COMPONENT must be stopped as group $USER not $GRP - exit 1 - fi + authcheck touch $APP_ROOT/etc/SHUTDOWN PIDS=`pids` if [ "$PIDS" != "" ]