From e6cbc624f11c588f9a32f98a7bb17a1df4885086 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Thu, 8 Sep 2016 15:35:09 -0300 Subject: [PATCH] Removed supervisord --- Dockerfile | 8 +--- container_files/bin/apache-grouper.sh | 14 ------- container_files/bin/main.sh | 2 +- container_files/bin/start.sh | 22 +++++++--- container_files/bin/tomcat-grouper.sh | 20 --------- container_files/conf/supervisord.conf | 59 --------------------------- 6 files changed, 19 insertions(+), 106 deletions(-) delete mode 100755 container_files/bin/apache-grouper.sh delete mode 100755 container_files/bin/tomcat-grouper.sh delete mode 100644 container_files/conf/supervisord.conf diff --git a/Dockerfile b/Dockerfile index 96bab613..7e14e0d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,19 +29,15 @@ RUN mkdir -p /opt/grouper/$VERSION \ java-1.8.0-openjdk \ java-1.8.0-openjdk-devel \ MariaDB-client \ - supervisor \ mlocate \ && yum clean all # The installer creates a HSQL DB which we ignore later -RUN mkdir -p /var/log/supervisor -RUN mv /etc/supervisord.conf /etc/supervisord.conf.old -COPY container_files/conf/supervisord.conf /etc WORKDIR /opt/grouper/$version RUN java -cp :grouperInstaller.jar edu.internet2.middleware.grouperInstaller.GrouperInstaller VOLUME /opt/grouper/2.3.0/apache-tomcat-$TOMCAT_VERSION/logs -EXPOSE 8080 8009 8005 9001 -CMD ["/usr/bin/supervisord"] +EXPOSE 8080 8009 8005 +CMD ["/opt/bin/start.sh"] diff --git a/container_files/bin/apache-grouper.sh b/container_files/bin/apache-grouper.sh deleted file mode 100755 index 08b12c6d..00000000 --- a/container_files/bin/apache-grouper.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/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" >> $log -done -echo "Starting Apache" >> $log -date >> $log -/usr/local/bin/httpd-shib-foreground diff --git a/container_files/bin/main.sh b/container_files/bin/main.sh index 3bda674b..e8c6178c 100755 --- a/container_files/bin/main.sh +++ b/container_files/bin/main.sh @@ -20,4 +20,4 @@ else echo "Grouper container has run." >> $log echo "If there are problems, docker rm this container and try again." >> $log fi -exit 0 +#exit 0 diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh index a97d138d..f72508ed 100755 --- a/container_files/bin/start.sh +++ b/container_files/bin/start.sh @@ -13,33 +13,43 @@ then echo "Not composed non-zero exit status: $laststatus" exit 1 else + echo "Grouper was configured" >>$log echo "Grouper was configured" - echo "Starting apache" - exit 0 - #/usr/local/bin/httpd-shib-foreground + 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 apache" - exit 0 - #/usr/local/bin/httpd-shib-foreground + 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 diff --git a/container_files/bin/tomcat-grouper.sh b/container_files/bin/tomcat-grouper.sh deleted file mode 100755 index 77fe2cf0..00000000 --- a/container_files/bin/tomcat-grouper.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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 -statusapache=$? - -while [ "$statusstart" != 0 ] && [ "$statusapache" == "0" ]; do -ps auxww |grep -iq start.sh -statusstart=$? -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" >> $log -done -echo "Starting Tomcat" >> $log -date >> $log -/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 deleted file mode 100644 index 979f7e27..00000000 --- a/container_files/conf/supervisord.conf +++ /dev/null @@ -1,59 +0,0 @@ -[supervisord] -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=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) -minprocs=200 ; (min. avail process descriptors;default 200) -;umask=022 ; (process file creation umask;default 022) -;user=chrism ; (default is current user, required if root) -;identifier=supervisor ; (supervisord identifier, default is 'supervisor') -;directory=/tmp ; (default is not to cd during start) -;nocleanup=true ; (don't clean up tempfiles at start;default false) -;childlogdir=/tmp ; ('AUTO' child log dir, default $TEMP) -;environment=KEY=value ; (key value pairs to add to environment) -;strip_ansi=false ; (strip ansi escape codes in logs; def. false) - -; the below section must remain in the config file for RPC -; (supervisorctl/web interface) to work, additional interfaces may be -; added by defining them in separate rpcinterface: sections -[rpcinterface:supervisor] -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=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_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 - - -[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