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 &
89 echo $COMPONENT startup failed
90 ls -l $APP_ROOT/logs/EELF
91 echo "------------ error.log ---------------"
92 cat $APP_ROOT/logs/EELF/error.log
93 echo "------------ server.log ---------------"
94 cat $APP_ROOT/logs/EELF/server.log
95 echo "------------ tail -100 application.log ---------------"
96 tail -100 $APP_ROOT/logs/EELF/application.log
98 echo $COMPONENT started
106 if [ "$ID" != "$USER" ]
108 echo $COMPONENT must be stopped as user $USER not $ID
111 if [ "$GRP" != "$USER" ]
113 echo $COMPONENT must be stopped as group $USER not $GRP
116 touch $APP_ROOT/etc/SHUTDOWN
123 echo $COMPONENT stopped
125 echo $COMPONENT not running
133 echo $COMPONENT running
135 echo $COMPONENT not running
161 echo "Usage: $0 { start | stop | restart }"