Blimkie, Steven (sb787e) | 9d2e583 | 2017-05-17 17:45:08 +0300 | [diff] [blame] | 1 | #!/bin/sh |
Blackwell, Ian (ib733q) | 7b1f813 | 2018-04-03 17:28:44 +0100 | [diff] [blame] | 2 | #******************************************************************************* |
| 3 | # ============LICENSE_START========================================== |
| 4 | # org.onap.aai |
| 5 | # =================================================================== |
| 6 | # Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. |
mark.j.leonard | 6e4f04a | 2018-04-26 16:53:12 +0100 | [diff] [blame] | 7 | # Copyright © 2017-2018 European Software Marketing Ltd. |
Blackwell, Ian (ib733q) | 7b1f813 | 2018-04-03 17:28:44 +0100 | [diff] [blame] | 8 | # =================================================================== |
| 9 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | # you may not use this file except in compliance with the License. |
| 11 | # You may obtain a copy of the License at |
| 12 | # |
| 13 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | # |
| 15 | # Unless required by applicable law or agreed to in writing, software |
| 16 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | # See the License for the specific language governing permissions and |
| 19 | # limitations under the License. |
| 20 | # ============LICENSE_END============================================ |
| 21 | #******************************************************************************* |
Blimkie, Steven (sb787e) | 9d2e583 | 2017-05-17 17:45:08 +0300 | [diff] [blame] | 22 | |
mark.j.leonard | 6e4f04a | 2018-04-26 16:53:12 +0100 | [diff] [blame] | 23 | # AJSC_HOME is required for EELF logging. |
| 24 | # This path is referenced in the file logback.xml. |
| 25 | AJSC_HOME="${AJSC_HOME-/opt/app/model-loader}" |
Blimkie, Steven (sb787e) | 9d2e583 | 2017-05-17 17:45:08 +0300 | [diff] [blame] | 26 | |
| 27 | if [ -z "$CONFIG_HOME" ]; then |
mark.j.leonard | 6e4f04a | 2018-04-26 16:53:12 +0100 | [diff] [blame] | 28 | echo "CONFIG_HOME must be set in order to start up the process" |
| 29 | echo "The expected value is a folder containing the model-loader.properties file" |
| 30 | exit 1 |
Blimkie, Steven (sb787e) | 9d2e583 | 2017-05-17 17:45:08 +0300 | [diff] [blame] | 31 | fi |
| 32 | |
mark.j.leonard | 6e4f04a | 2018-04-26 16:53:12 +0100 | [diff] [blame] | 33 | JARFILE="$AJSC_HOME/model-loader.jar" |
| 34 | |
| 35 | # Some properties are repeated here for debugging purposes. |
Blimkie, Steven (sb787e) | 9d2e583 | 2017-05-17 17:45:08 +0300 | [diff] [blame] | 36 | PROPS="-DAJSC_HOME=$AJSC_HOME" |
Blimkie, Steven (sb787e) | 9d2e583 | 2017-05-17 17:45:08 +0300 | [diff] [blame] | 37 | PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME" |
mark.j.leonard | 6e4f04a | 2018-04-26 16:53:12 +0100 | [diff] [blame] | 38 | PROPS="$PROPS -Dcom.att.eelf.logging.path=$AJSC_HOME" |
| 39 | PROPS="$PROPS -Dcom.att.eelf.logging.file=logback.xml" |
| 40 | PROPS="$PROPS -Dlogback.configurationFile=$AJSC_HOME/logback.xml" |
| 41 | PROPS="$PROPS -Dserver.port=9500" |
abatos | 0cecd0b | 2017-06-09 09:36:30 -0400 | [diff] [blame] | 42 | JVM_MAX_HEAP=${MAX_HEAP:-1024} |
Blimkie, Steven (sb787e) | 9d2e583 | 2017-05-17 17:45:08 +0300 | [diff] [blame] | 43 | |
mark.j.leonard | 6e4f04a | 2018-04-26 16:53:12 +0100 | [diff] [blame] | 44 | if [ -z "${java_runtime_arguments}" ]; then |
| 45 | java_runtime_arguments="-Xms75m -Xmx${JVM_MAX_HEAP}m \ |
| 46 | -Dcom.sun.management.jmxremote \ |
| 47 | -Dcom.sun.management.jmxremote.authenticate=false \ |
| 48 | -Dcom.sun.management.jmxremote.ssl=false \ |
| 49 | -Dcom.sun.management.jmxremote.local.only=false \ |
| 50 | -Dcom.sun.management.jmxremote.port=1099 \ |
| 51 | -Dcom.sun.management.jmxremote.rmi.port=1099 \ |
| 52 | -Djava.rmi.server.hostname=127.0.0.1" |
| 53 | fi |
Blimkie, Steven (sb787e) | 9d2e583 | 2017-05-17 17:45:08 +0300 | [diff] [blame] | 54 | |
mark.j.leonard | 6e4f04a | 2018-04-26 16:53:12 +0100 | [diff] [blame] | 55 | echo "java $java_runtime_arguments $PROPS -jar $JARFILE" |
| 56 | java $java_runtime_arguments $PROPS -jar $JARFILE |