Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
grouper/container_files/bin/start.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
55 lines (54 sloc)
1.9 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
log="/tmp/start-starting.log" | |
date >> $log | |
if [ -z ${COMPOSE+x} ] | |
then | |
echo "Not composed so not waiting for MariaDB: " > $log | |
/opt/bin/main.sh | |
laststatus="$?" | |
echo "Not composed status: $laststatus" | |
if [ "$laststatus" != "0" ]; then | |
echo "Not composed non-zero exit status: $laststatus" >> $log | |
echo "Not composed non-zero exit status: $laststatus" | |
exit 1 | |
else | |
echo "Grouper was configured" >>$log | |
echo "Grouper was configured" | |
echo "Starting tomcat and apache" >>$log | |
echo "Starting tomcat and apache" | |
/usr/local/bin/httpd-shib-foreground & | |
/opt/grouper/2.3.0/apache-tomcat-6.0.35/bin/catalina.sh run | |
fi | |
else | |
echo "Composed so waiting for MariaDB: " > $log | |
date >> $log | |
echo "Testing connectivy to database before continue with install" | |
mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -h "$MYSQL_HOST" -e "use grouper; show tables;" | |
laststatus="$?" | |
echo "checking connectivity" >> $log | |
while [ "$laststatus" != "0" ]; do | |
mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -h "$MYSQL_HOST" -e "use grouper; show tables;" | |
laststatus="$?" | |
sleep 5 | |
date >> $log | |
echo "Trying to connect to mariadb container with $MYSQL_USER to database $MYSQL_DATABASE" | |
echo "Trying to connect to mariadb container with $MYSQL_USER to database $MYSQL_DATABASE" >> $log | |
done | |
/opt/bin/main.sh | |
laststatus="$?" | |
echo "Composed status: $laststatus" | |
echo "Composed status: $laststatus" >>$log | |
if [ "$laststatus" != "0" ]; then | |
echo "Composed non-zero exit status: $laststatus" >> $log | |
echo "Composed non-zero exit status: $laststatus" | |
exit 1 | |
else | |
echo "Grouper was configured" >>$log | |
echo "Grouper was configured" | |
echo "Starting tomcat and apache" >>$log | |
echo "Starting tomcat and apache" | |
date >> $log | |
/usr/local/bin/httpd-shib-foreground & | |
/opt/grouper/2.3.0/apache-tomcat-6.0.35/bin/catalina.sh run | |
fi | |
fi |