"Fossies" - the Fresh Open Source Software Archive

Member "monasca-log-api-2.9.0/docker/start.sh" (1 Apr 2019, 1866 Bytes) of package /linux/misc/openstack/monasca-log-api-2.9.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 #  Licensed under the Apache License, Version 2.0 (the "License"); you may
    4 #  not use this file except in compliance with the License. You may obtain
    5 #  a copy of the License at
    6 #
    7 #       http://www.apache.org/licenses/LICENSE-2.0
    8 #
    9 #  Unless required by applicable law or agreed to in writing, software
   10 #  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   11 #  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   12 #  License for the specific language governing permissions and limitations
   13 #  under the License.
   14 
   15 # Starting script.
   16 # All checks and configuration templating you need to do before service
   17 # could be safely started should be added in this file.
   18 
   19 set -eo pipefail  # Exit the script if any statement returns error.
   20 
   21 # Test services we need before starting our service.
   22 echo "Start script: waiting for needed services"
   23 python3 /kafka_wait_for_topics.py
   24 
   25 # Template all config files before start, it will use env variables.
   26 # Read usage examples: https://pypi.org/project/Templer/
   27 echo "Start script: creating config files from templates"
   28 templer -v -f /etc/monasca/monasca-log-api.conf.j2  /etc/monasca/monasca-log-api.conf
   29 templer -v -f /etc/monasca/log-api-gunicorn.conf.j2 /etc/monasca/log-api-gunicorn.conf
   30 templer -v -f /etc/monasca/log-api-logging.conf.j2  /etc/monasca/log-api-logging.conf
   31 templer -v -f /etc/monasca/log-api-paste.ini.j2     /etc/monasca/log-api-paste.ini
   32 
   33 # Start our service.
   34 # gunicorn --args
   35 echo "Start script: starting container"
   36 gunicorn \
   37     --config /etc/monasca/log-api-gunicorn.conf \
   38     --paste /etc/monasca/log-api-paste.ini
   39 
   40 # Allow server to stay alive in case of failure for 2 hours for debugging.
   41 RESULT=$?
   42 if [ $RESULT != 0 ] && [ "$STAY_ALIVE_ON_FAILURE" = "true" ]; then
   43   echo "Service died, waiting 120 min before exiting"
   44   sleep 7200
   45 fi
   46 exit $RESULT