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 ls -l $APP_ROOT/logs/EELF
90 echo "------------ error.log ---------------"
91 cat $APP_ROOT/logs/EELF/error.log
92 echo "------------ server.log ---------------"
93 cat $APP_ROOT/logs/EELF/server.log
94 echo "------------ tail -100 application.log ---------------"
95 tail -100 $APP_ROOT/logs/EELF/application.log
97 echo $COMPONENT started
105 if [ "$ID" != "$USER" ]
107 echo $COMPONENT must be stopped as user $USER not $ID
110 if [ "$GRP" != "$USER" ]
112 echo $COMPONENT must be stopped as group $USER not $GRP
115 touch $APP_ROOT/etc/SHUTDOWN
122 echo $COMPONENT stopped
124 echo $COMPONENT not running
132 echo $COMPONENT running
134 echo $COMPONENT not running
160 echo "Usage: $0 { start | stop | restart }"