Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added more logic to scripts
villadalmine committed Sep 8, 2016
1 parent 7c93df1 commit c1a6140
Showing 4 changed files with 18 additions and 10 deletions.
8 changes: 5 additions & 3 deletions container_files/bin/apache-grouper.sh 100644 → 100755
@@ -1,12 +1,14 @@
#!/bin/bash

log=/tmp/apache-supervisor.log
date >> $log
ps auxww |grep -iq start.sh
statusstart=$?

while [ "$statusstart" != 0 ]; do
ps auxww |grep -iq start.sh
statusstart=$?
echo "First start configuration is in process, please wait"
echo "First start configuration is in process, please wait" >> $log
done
echo "Starting Apache"
echo "Starting Apache" >> $log
date >> $log
/usr/local/bin/httpd-shib-foreground
2 changes: 1 addition & 1 deletion container_files/bin/check.sh
@@ -12,4 +12,4 @@ echo "Adding Quickstart data" >> $log
cd /opt/grouper/2.3.0/grouper.apiBinary-2.3.0 && GROUPER_HOME=/opt/grouper/2.3.0/grouper.apiBinary-2.3.0 bin/gsh.sh -xmlimportold GrouperSystem /opt/grouper/2.3.0/quickstart.xml -noprompt >> $log

echo "Checking" >> $log
cd /opt/grouper/2.3.0/grouper.apiBinary-2.3.0 && GROUPER_HOME=/opt/grouper/2.3.0/grouper.apiBinary-2.3.0 bin/gsh.sh -registry -check -noprompt >> $log
cd /opt/grouper/2.3.0/grouper.apiBinary-2.3.0 && GROUPER_HOME=/opt/grouper/2.3.0/grouper.apiBinary-2.3.0 bin/gsh.sh -registry -check --noprompt >> $log
10 changes: 6 additions & 4 deletions container_files/bin/tomcat-grouper.sh
@@ -1,5 +1,6 @@
#!/bin/bash

log=/tmp/tomcat-apache-supervisor.log
date >> $log
ps auxww |grep -iq start.sh
statusstart=$?
ps auxww | grep -iq bin/httpd-shib-foreground
@@ -8,11 +9,12 @@ statusapache=$?
while [ "$statusstart" != 0 ] && [ "$statusapache" == "0" ]; do
ps auxww |grep -iq start.sh
statusstart=$?
echo "First start configuration is in process, please wait"
echo "First start configuration is in process, please wait" >> $log
ps auxww | grep -iq bin/httpd-shib-foreground
statusapache=$?
echo "Apache is not running, please wait"
echo "Apache is not running, please wait" >> $log
done
echo "Starting Tomcat"
echo "Starting Tomcat" >> $log
date >> $log
/opt/grouper/2.3.0/apache-tomcat-6.0.35/bin/catalina.sh run

8 changes: 6 additions & 2 deletions container_files/conf/supervisord.conf
@@ -33,15 +33,17 @@ history_file=~/.sc_history ; use readline history if available

[program:configure]
command=/bin/bash -c "exec /opt/bin/start.sh"
tdout_logfile=/var/log/start_log
stderr_logfile=/var/log/start_log
tdout_logfile=/var/log/start_supervisor.log
stderr_logfile=/var/log/start_error_supervisor.log
autorestart=false
autostart=true
priority=1
startsec=30

[program:apache]
command=/bin/bash -c "exec /opt/bin/apache-grouper.sh"
tdout_logfile=/var/log/apache_supervisor_log
stderr_logfile=/var/log/apache_error_supervisor_log
autostart=true
autorestart=true
priority=11
@@ -50,6 +52,8 @@ priority=11
[program:tomcat]
command=/bin/bash -c "exec /opt/bin/tomcat-grouper.sh"
autorestart=true
tdout_logfile=/var/log/tomcat_supervisor_log
stderr_logfile=/var/log/tomcat_error_supervisor_log
autostart=true
priority=999
startsec=10

0 comments on commit c1a6140

Please sign in to comment.