Skip to content

Commit

Permalink
[ FAB-5434 ] Fix mysql internal_DB permissions
Browse files Browse the repository at this point in the history
Fixes the initialization error of mysql server
in fvt tests. This is a problem that is exclusive to
the x86 CI build machines.

Change-Id: I054911218d1906e7a6ecf221e89bc9bee129ac3c
Signed-off-by: rennman <[email protected]>
  • Loading branch information
rennman committed Jul 28, 2017
1 parent 86a6d7d commit d24c05c
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions images/fabric-ca-fvt/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,12 @@

POSTGRES_PORT=5432
MYSQL_PORT=3306
MYSQL_VERSION=`mysqld --version|awk '{print $3}'`
LDAP_PORT=389
PORTS=($POSTGRES_PORT $MYSQL_PORT $LDAP_PORT)

timeout=12
su postgres -c 'postgres -D /usr/local/pgsql/data' &
# we need to check the version of mysql as behavior has changed with 5.7.19+
if [[ $MYSQL_VERSION == 5.7* ]] ;
then
echo "detected mysql version ${MYSQL_VERSION}"
rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \
&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \
&& chmod 777 /var/run/mysqld
mysqld --initialize-insecure
fi

chown -R mysql.mysql /var/lib/mysql
/usr/bin/mysqld_safe --sql-mode=STRICT_TRANS_TABLES &
# Set "olcIdleTimeout" to 1 second to force slapd (the LDAP server) to
# close connections after they have been idle for 1 second. This is
Expand All @@ -42,11 +32,4 @@ for port in ${PORTS[*]}; do
done
done

if [[ $MYSQL_VERSION == 5.7* ]] ;
then
# Set mysql root password
sleep 3
mysqladmin -u root password mysql
fi

exec "$@"

0 comments on commit d24c05c

Please sign in to comment.