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
20 ps -ef | grep java | grep $MAIN | sed -e 's/[^ ]* *//' -e 's/ .*//'
28 echo "Expected app root directory $APP_ROOT does not exist"
31 if [ ! -f $CONTAINER_CONFIG ]
33 echo "Expected env file $CONTAINER_CONFIG not found"
37 source $CONTAINER_CONFIG
39 if [ "$DMAAPBC_WAIT_TO_EXIT" != "Y" ]
41 echo "Creating $APP_ROOT/ok_to_exit so no waiting..."
42 > $APP_ROOT/ok_to_exit
44 echo "Not creating $APP_ROOT/ok_to_exit"
46 # comment out till certs are available
47 #if [ ! -f $APP_ROOT/misc/cert-client-init.sh ]
49 # echo "Did not find $APP_ROOT/misc/cert-client-init.sh to append to truststore"
52 #$APP_ROOT/misc/cert-client-init.sh
53 . misc/dmaapbc.properties.tmpl > etc/dmaapbc.properties
54 . misc/PolicyEngineApi.properties.tmpl > config/PolicyEngineApi.properties
62 if [ "$ID" != "$USER" ]
64 echo $COMPONENT must be started as user $USER not $ID
67 if [ "$GRP" != "$USER" ]
69 echo $COMPONENT must be started as group $USER not $GRP
74 # disable until we use certs
79 # echo No certificate file available. Cannot start
85 echo $COMPONENT already running
88 rm -f $APP_ROOT/etc/SHUTDOWN
91 #old line from Dockerfile...keep for reference only
92 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"
93 #nohup java $FLAGS $MAIN </dev/null >/dev/null 2>&1 &
94 nohup java $FLAGS $MAIN </dev/null &
103 if [ "$ID" != "$USER" ]
105 echo $COMPONENT must be stopped as user $USER not $ID
108 if [ "$GRP" != "$USER" ]
110 echo $COMPONENT must be stopped as group $USER not $GRP
113 touch $APP_ROOT/etc/SHUTDOWN
120 echo $COMPONENT stopped
122 echo $COMPONENT not running
130 echo $COMPONENT running
132 echo $COMPONENT not running
158 echo "Usage: $0 { start | stop | restart }"
162 ls -l $APP_ROOT/logs/EELF
163 echo "------------ tail -100 error.log ---------------"
164 tail -100 $APP_ROOT/logs/EELF/error.log
165 echo "------------ tail -100 server.log ---------------"
166 tail -100 $APP_ROOT/logs/EELF/server.log
167 echo "------------ tail -100 application.log ---------------"
168 tail -100 $APP_ROOT/logs/EELF/application.log
170 echo "Check $APP_ROOT/ok_to_exit"
171 while [ ! -f $APP_ROOT/ok_to_exit ]
173 echo "$APP_ROOT/ok_to_exit does not exist. Sticking around for debugging..."