diff --git a/images/fabric-ca-fvt/Dockerfile.in b/images/fabric-ca-fvt/Dockerfile.in index fb8ab195b..50b9c79ec 100644 --- a/images/fabric-ca-fvt/Dockerfile.in +++ b/images/fabric-ca-fvt/Dockerfile.in @@ -30,12 +30,18 @@ RUN dpkg-reconfigure locales && update-locale LANG=en_US.UTF-8 # Install more test depedencies RUN echo "mysql-server mysql-server/root_password password mysql" | debconf-set-selections RUN echo "mysql-server mysql-server/root_password_again password mysql" | debconf-set-selections -RUN apt-get -y install --no-install-recommends bc vim lsof sqlite3 haproxy postgresql-$PGVER \ +RUN apt-get -y install --no-install-recommends rsyslog bc vim lsof sqlite3 haproxy postgresql-$PGVER \ postgresql-client-common postgresql-contrib-$PGVER isag jq git html2text \ debconf-utils zsh htop python2.7-minimal libpython2.7-stdlib \ mysql-client mysql-common mysql-server RUN apt-get -y autoremove +# Configure rsyslog + # Include the imudp modules (syslog messages via UDP) by uncommenting +RUN sed -i 's/^[[:blank:]]*#\([[:blank:]]*.*imudp.*\)/\1/' /etc/rsyslog.conf +RUN rm /etc/rsyslog.d/*haproxy*conf +RUN printf "local2.* /var/log/haproxy.log\n& ~\n" > /etc/rsyslog.d/haproxy.conf + # Configure and start postgres RUN echo $PGUSER:$PGUSER | chpasswd RUN mkdir -p $PGDATA && chown postgres:postgres $PGDATA diff --git a/images/fabric-ca-fvt/start.sh b/images/fabric-ca-fvt/start.sh index 5b6a21c8a..e47c74980 100755 --- a/images/fabric-ca-fvt/start.sh +++ b/images/fabric-ca-fvt/start.sh @@ -11,6 +11,7 @@ LDAP_PORT=389 PORTS=($POSTGRES_PORT $MYSQL_PORT $LDAP_PORT) timeout=12 +service rsyslog start su postgres -c 'postgres -D /usr/local/pgsql/data' & chown -R mysql.mysql /var/lib/mysql /usr/bin/mysqld_safe --sql-mode=STRICT_TRANS_TABLES & diff --git a/scripts/fvt/fabric-ca_setup.sh b/scripts/fvt/fabric-ca_setup.sh index 1df3c89e0..e6ac2f7e3 100755 --- a/scripts/fvt/fabric-ca_setup.sh +++ b/scripts/fvt/fabric-ca_setup.sh @@ -129,8 +129,7 @@ function startHaproxy() { case $TLS_ON in "true") haproxy -f <(echo "global - log /dev/log local0 debug - log /dev/log local1 debug + log 127.0.0.1 local2 daemon defaults log global @@ -149,14 +148,17 @@ frontend haproxy backend fabric-cas mode tcp balance roundrobin"; - while test $((i++)) -lt $inst; do - echo " server server$i 127.0.0.$i:$server_port" - done) + # For each requested instance passed to startHaproxy + # (which is determined by the -n option passed to the + # main script) create a backend server in haproxy config + # Each server uses a separate loopback address. + while test $((i++)) -lt $inst; do + echo " server server$i 127.0.0.$i:$server_port" + done) ;; *) haproxy -f <(echo "global - log /dev/log local0 debug - log /dev/log local1 debug + log 127.0.0.1 local2 daemon defaults log global