Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added some logic.. still testing
villadalmine committed Sep 8, 2016
1 parent b600f3e commit 7c93df1
Showing 4 changed files with 54 additions and 11 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
@@ -43,6 +43,5 @@ RUN java -cp :grouperInstaller.jar edu.internet2.middleware.grouperInstaller.Gro

VOLUME /opt/grouper/2.3.0/apache-tomcat-$TOMCAT_VERSION/logs

EXPOSE 8080 8009 8005
EXPOSE 8080 8009 8005 9001
CMD ["/usr/bin/supervisord"]
#CMD ["/opt/bin/start.sh"]
12 changes: 12 additions & 0 deletions container_files/bin/apache-grouper.sh
@@ -0,0 +1,12 @@
#!/bin/bash

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"
done
echo "Starting Apache"
/usr/local/bin/httpd-shib-foreground
18 changes: 18 additions & 0 deletions container_files/bin/tomcat-grouper.sh
@@ -0,0 +1,18 @@
#!/bin/bash

ps auxww |grep -iq start.sh
statusstart=$?
ps auxww | grep -iq bin/httpd-shib-foreground
statusapache=$?

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

32 changes: 23 additions & 9 deletions container_files/conf/supervisord.conf
@@ -2,7 +2,7 @@
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
loglevel=debug ; (log level;default info; others: debug,warn,trace)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=true ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
@@ -23,19 +23,33 @@ minprocs=200 ; (min. avail process descriptors;default 200)
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor/supervisor.sock ; use a unix:// URL for a unix socket
;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
;username=chris ; should be same as http_username if set
;password=123 ; should be same as http_password if set
;prompt=mysupervisor ; cmd line prompt (default "supervisor")
;history_file=~/.sc_history ; use readline history if available
;serverurl=unix:///var/run/supervisor/supervisor.sock ; use a unix:// URL for a unix socket
serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
username=grouper ; should be same as http_username if set
password=grouper ; should be same as http_password if set
prompt=grouppersupervisor ; cmd line prompt (default "supervisor")
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
autorestart=false
autostart=true
priority=1
startsec=30

[program:apache]
command=/bin/bash -c "exec /usr/local/bin/httpd-shib-foreground"
command=/bin/bash -c "exec /opt/bin/apache-grouper.sh"
autostart=true
autorestart=true
priority=11


[program:tomcat]
command=/bin/bash -c "exec /opt/grouper/2.3.0/apache-tomcat-6.0.35/bin/catalina.sh run"
command=/bin/bash -c "exec /opt/bin/tomcat-grouper.sh"
autorestart=true
autostart=true
priority=999
startsec=10

0 comments on commit 7c93df1

Please sign in to comment.