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"
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/havecert.tmpl > etc/havecert
55 . misc/dmaapbc.properties.tmpl > etc/dmaapbc.properties
56 . misc/PolicyEngineApi.properties.tmpl > config/PolicyEngineApi.properties
64 if [ "$ID" != "$USER" ]
66 echo $COMPONENT must be started as user $USER not $ID
69 if [ "$GRP" != "$USER" ]
71 echo $COMPONENT must be started as group $USER not $GRP
80 echo No certificate file available. Cannot start
86 echo $COMPONENT already running
89 rm -f $APP_ROOT/etc/SHUTDOWN
92 #old line from Dockerfile...keep for reference only
93 FLAGS="-cp etc:lib/* -Dlog4j.configuration=etc/log4j.properties -Ddmaapbc.properties=etc/dmaapbc.properties -Dlogback.configurationFile=etc/logback.xml -Dhttps.protocols=TLSv1.2 -Dhttps.cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"
94 #nohup java $FLAGS $MAIN </dev/null >/dev/null 2>&1 &
95 nohup java $FLAGS $MAIN </dev/null &
104 if [ "$ID" != "$USER" ]
106 echo $COMPONENT must be stopped as user $USER not $ID
109 if [ "$GRP" != "$USER" ]
111 echo $COMPONENT must be stopped as group $USER not $GRP
114 touch $APP_ROOT/etc/SHUTDOWN
121 echo $COMPONENT stopped
123 echo $COMPONENT not running
131 echo $COMPONENT running
133 echo $COMPONENT not running
159 echo "Usage: $0 { start | stop | restart }"
163 ls -l $APP_ROOT/logs/EELF
164 echo "------------ tail -100 error.log ---------------"
165 tail -100 $APP_ROOT/logs/EELF/error.log
166 echo "------------ tail -100 server.log ---------------"
167 tail -100 $APP_ROOT/logs/EELF/server.log
168 echo "------------ tail -100 application.log ---------------"
169 tail -100 $APP_ROOT/logs/EELF/application.log
171 echo "Check $APP_ROOT/ok_to_exit"
172 while [ ! -f $APP_ROOT/ok_to_exit ]
174 echo "$APP_ROOT/ok_to_exit does not exist. Sticking around for debugging..."