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 # comment out till certs are available
38 #if [ ! -f $APP_ROOT/misc/cert-client-init.sh ]
40 # echo "Did not find $APP_ROOT/misc/cert-client-init.sh to append to truststore"
43 #$APP_ROOT/misc/cert-client-init.sh
44 . misc/dmaapbc.properties.tmpl > etc/dmaapbc.properties
45 . misc/PolicyEngineApi.properties.tmpl > config/PolicyEngineApi.properties
53 if [ "$ID" != "$USER" ]
55 echo $COMPONENT must be started as user $USER not $ID
58 if [ "$GRP" != "$USER" ]
60 echo $COMPONENT must be started as group $USER not $GRP
65 # disable until we use certs
70 # echo No certificate file available. Cannot start
76 echo $COMPONENT already running
79 rm -f $APP_ROOT/etc/SHUTDOWN
82 #old line from Dockerfile...keep for reference only
83 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"
84 #nohup java $FLAGS $MAIN </dev/null >/dev/null 2>&1 &
85 nohup java $FLAGS $MAIN </dev/null &
94 if [ "$ID" != "$USER" ]
96 echo $COMPONENT must be stopped as user $USER not $ID
99 if [ "$GRP" != "$USER" ]
101 echo $COMPONENT must be stopped as group $USER not $GRP
104 touch $APP_ROOT/etc/SHUTDOWN
111 echo $COMPONENT stopped
113 echo $COMPONENT not running
121 echo $COMPONENT running
123 echo $COMPONENT not running
149 echo "Usage: $0 { start | stop | restart }"
153 ls -l $APP_ROOT/logs/EELF
154 echo "------------ tail -100 error.log ---------------"
155 tail -100 $APP_ROOT/logs/EELF/error.log
156 echo "------------ tail -100 server.log ---------------"
157 tail -100 $APP_ROOT/logs/EELF/server.log
158 echo "------------ tail -100 application.log ---------------"
159 tail -100 $APP_ROOT/logs/EELF/application.log