diff --git a/Dockerfile b/Dockerfile index ab43f183..96bab613 100644 --- a/Dockerfile +++ b/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"] diff --git a/container_files/bin/apache-grouper.sh b/container_files/bin/apache-grouper.sh new file mode 100644 index 00000000..95042b6a --- /dev/null +++ b/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 diff --git a/container_files/bin/tomcat-grouper.sh b/container_files/bin/tomcat-grouper.sh new file mode 100755 index 00000000..5ae9fcbb --- /dev/null +++ b/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 + diff --git a/container_files/conf/supervisord.conf b/container_files/conf/supervisord.conf index f487b477..f3bff527 100644 --- a/container_files/conf/supervisord.conf +++ b/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