3 # ============LICENSE_START==========================================
5 # ===================================================================
6 # Copyright © 2018 AT&T Intellectual Property. All rights reserved.
7 # ===================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ============LICENSE_END============================================
20 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
27 APP_ROOT=/opt/app/$COMPONENT
30 PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/java/jdk/jdk180/bin
32 CLASSPATH=`echo $APP_ROOT/etc $APP_ROOT/lib/*.jar | tr ' ' ':'`
34 CONTAINER_CONFIG=/opt/app/config/conf
35 MAIN=org.onap.dmaap.dbcapi.server.Main
41 ps -ef | grep java | grep $MAIN | sed -e 's/[^ ]* *//' -e 's/ .*//'
49 echo "Expected app root directory $APP_ROOT does not exist"
52 if [ ! -f $CONTAINER_CONFIG ]
54 echo "Expected env file $CONTAINER_CONFIG not found"
58 source $CONTAINER_CONFIG
60 if [ "$DMAAPBC_WAIT_TO_EXIT" != "Y" ]
62 echo "Creating $APP_ROOT/ok_to_exit so no waiting..."
63 > $APP_ROOT/ok_to_exit
65 echo "Not creating $APP_ROOT/ok_to_exit"
68 if [ ! -f $APP_ROOT/misc/cert-client-init.sh ]
70 echo "Did not find $APP_ROOT/misc/cert-client-init.sh to append to truststore"
73 $APP_ROOT/misc/cert-client-init.sh
74 . misc/havecert.tmpl > etc/havecert
76 . misc/dmaapbc.properties.tmpl > etc/dmaapbc.properties
77 . misc/PolicyEngineApi.properties.tmpl > config/PolicyEngineApi.properties
85 if [ "$ID" != "$USER" ]
87 echo $COMPONENT must be started as user $USER not $ID
90 if [ "$GRP" != "$USER" ]
92 echo $COMPONENT must be started as group $USER not $GRP
101 echo No certificate file available. Cannot start
107 echo $COMPONENT already running
110 rm -f $APP_ROOT/etc/SHUTDOWN
113 #old line from Dockerfile...keep for reference only
114 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"
115 #nohup java $FLAGS $MAIN </dev/null >/dev/null 2>&1 &
116 nohup java $FLAGS $MAIN </dev/null &
125 if [ "$ID" != "$USER" ]
127 echo $COMPONENT must be stopped as user $USER not $ID
130 if [ "$GRP" != "$USER" ]
132 echo $COMPONENT must be stopped as group $USER not $GRP
135 touch $APP_ROOT/etc/SHUTDOWN
142 echo $COMPONENT stopped
144 echo $COMPONENT not running
152 echo $COMPONENT running
154 echo $COMPONENT not running
180 echo "Usage: $0 { start | stop | restart }"
184 ls -l $APP_ROOT/logs/ONAP
185 echo "------------ tail -100 error.log ---------------"
186 tail -100 $APP_ROOT/logs/ONAP/error.log
187 echo "------------ tail -100 server.log ---------------"
188 tail -100 $APP_ROOT/logs/ONAP/server.log
189 echo "------------ tail -100 application.log ---------------"
190 tail -100 $APP_ROOT/logs/ONAP/application.log
192 echo "Check $APP_ROOT/ok_to_exit"
193 while [ ! -f $APP_ROOT/ok_to_exit ]
195 echo "$APP_ROOT/ok_to_exit does not exist. Sticking around for debugging..."