6 APP_ROOT=/opt/app/$COMPONENT
9 PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/java/jdk/jdk180/bin
11 CLASSPATH=`echo $APP_ROOT/etc $APP_ROOT/lib/*.jar | tr ' ' ':'`
13 CONTAINER_CONFIG=/opt/app/config/conf
14 MAIN=org.onap.dmaap.dbcapi.server.Main
19 ps -ef | grep java | grep $MAIN | sed -e 's/[^ ]* *//' -e 's/ .*//'
27 echo "Expected app root directory $APP_ROOT does not exist"
30 if [ ! -f $CONTAINER_CONFIG ]
32 echo "Expected env file $CONTAINER_CONFIG not found"
36 source $CONTAINER_CONFIG
37 if [ ! -f $APP_ROOT/misc/cert-client-init.sh ]
39 echo "Did not find $APP_ROOT/misc/cert-client-init.sh to append to truststore"
42 $APP_ROOT/misc/cert-client-init.sh
43 . misc/dmaapbc.properties.tmpl > etc/dmaapbc.properties
44 . misc/PolicyEngineApi.properties.tmpl > config/PolicyEngineApi.properties
52 if [ "$ID" != "$USER" ]
54 echo $COMPONENT must be started as user $USER not $ID
57 if [ "$GRP" != "$USER" ]
59 echo $COMPONENT must be started as group $USER not $GRP
64 # disable until we use certs
69 # echo No certificate file available. Cannot start
75 echo $COMPONENT already running
78 rm -f $APP_ROOT/etc/SHUTDOWN
81 #old line from Dockerfile...keep for reference only
82 FLAGS="-cp etc:lib/* -Dlog4j.configuration=etc/log4j.properties -Ddmaapbc.properties=etc/dmaapbc.properties -Dhttps.protocols=TLSv1.2 -Dhttps.cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"
83 nohup java $FLAGS $MAIN </dev/null >/dev/null 2>&1 &
88 echo $COMPONENT startup failed
89 tail -100 $APP_ROOT/logs/dmaap*.log
91 echo $COMPONENT started
99 if [ "$ID" != "$USER" ]
101 echo $COMPONENT must be stopped as user $USER not $ID
104 if [ "$GRP" != "$USER" ]
106 echo $COMPONENT must be stopped as group $USER not $GRP
109 touch $APP_ROOT/etc/SHUTDOWN
116 echo $COMPONENT stopped
118 echo $COMPONENT not running
126 echo $COMPONENT running
128 echo $COMPONENT not running
154 echo "Usage: $0 { start | stop | restart }"