docker-entrypoint.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env bash
  2. echo "Initial nslookup ${HOSTNAME}.${APPNET}"
  3. nslookup ${HOSTNAME}.${APPNET}
  4. while [ $? -ne 0 ]; do
  5. echo "Waiting for ${HOSTNAME}.${APPNET} to become available"
  6. sleep 1
  7. nslookup ${HOSTNAME}.${APPNET}
  8. done
  9. echo "Initial nslookup tasks.${ADMIN_HOST}.${APPNET}"
  10. nslookup tasks.${ADMIN_HOST}.${APPNET}
  11. while [ $? -ne 0 ]; do
  12. echo "Waiting for tasks.${ADMIN_HOST}.${APPNET} to become available"
  13. sleep 1
  14. nslookup tasks.${ADMIN_HOST}.${APPNET}
  15. done
  16. # See Redmine 108967
  17. ADMIN_IP=$(dig tasks.${ADMIN_HOST}.${APPNET} +short)
  18. NODE_IP=$(dig ${HOSTNAME}.${APPNET} +short)
  19. echo ${ADMIN_IP} > /tmp/admin_ip
  20. #export ${ADMIN_IP}
  21. #export ${NODE_IP}
  22. sed -i "s/DB_CLUSTER/\"${DB_CLUSTER}\"/" /etc/web-laboratory/application.conf
  23. sed -i "s/ADMIN_HOST/$(dig tasks.${ADMIN_HOST}.${APPNET} +short)/" /etc/web-laboratory/application.conf
  24. sed -i "s/NODE_HOST/$(dig ${HOSTNAME}.${APPNET} +short)/" /etc/web-laboratory/application.conf
  25. # Добавлено логирование для manager memcached. Redmine 107228
  26. echo "de.javakaffee.web.msm.level = ${DEBUG}" >> /opt/tomcat/conf/logging.properties
  27. echo "net.spy.memcached.level = ${DEBUG}" >> /opt/tomcat/conf/logging.properties
  28. # Включение аунтификации по smb протоколу, https://corp.sdsys.ru/trac/sds/ticket/51455
  29. if [[ ! -z $SMB_USERNAME ]]; then
  30. sed -i "s/auth-enable: false/auth-enable: true/" /etc/web-laboratory/application.conf
  31. sed -i "s/username: \"\"/username: \"${SMB_USERNAME}\"/" /etc/web-laboratory/application.conf
  32. sed -i "s/domain: \"\"/domain: \"${SMB_DOMAIN}\"/" /etc/web-laboratory/application.conf
  33. sed -i "s/password: \"\"/password: \"${SMB_PASSWORD}\"/" /etc/web-laboratory/application.conf
  34. fi
  35. source /etc/init.d/web-laboratory status
  36. exec "$@"