Kolla provides production-ready containers and deployment tools for operating OpenStack clouds
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

extend_start.sh 1.1KB

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. SERVICE="monasca-log-api"
  3. # NOTE(pbourke): httpd will not clean up after itself in some cases which
  4. # results in the container not being able to restart. (bug #1489676, 1557036)
  5. if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then
  6. # Loading Apache2 ENV variables
  7. . /etc/apache2/envvars
  8. rm -rf /var/run/apache2/*
  9. else
  10. rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
  11. fi
  12. # When Apache first starts it writes out the custom log files with root
  13. # ownership. This later prevents the Monasca Log API (which runs under the
  14. # 'monasca' user) from updating them. To avoid this we create the log
  15. # files with the required permissions here, before Apache does.
  16. MONASCA_LOG_API_LOG_DIR="/var/log/kolla/monasca"
  17. for LOG_TYPE in error access; do
  18. if [ ! -f "${MONASCA_LOG_API_LOG_DIR}/${SERVICE}-${LOG_TYPE}.log" ]; then
  19. touch ${MONASCA_LOG_API_LOG_DIR}/${SERVICE}-${LOG_TYPE}.log
  20. fi
  21. if [[ $(stat -c %U:%G ${MONASCA_LOG_API_LOG_DIR}/${SERVICE}-${LOG_TYPE}.log) != "monasca:kolla" ]]; then
  22. chown monasca:kolla ${MONASCA_LOG_API_LOG_DIR}/${SERVICE}-${LOG_TYPE}.log
  23. fi
  24. done