Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.9
obs-server
obs-server-2.9-0043-api-fix-build-for-mariadb-1...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File obs-server-2.9-0043-api-fix-build-for-mariadb-10.4.patch of Package obs-server
From 357e79a2ee46fa46d1addfd5d423d92499e25ffd Mon Sep 17 00:00:00 2001 From: Ruediger Oertel <ro@suse.de> Date: Wed, 11 Mar 2020 14:43:27 +0100 Subject: [PATCH] [api] fix build for mariadb-10.4 build using the current user and try not to break older mariadb revisions in the process where socket auth was not loaded by default. --- src/api/script/api_test_in_spec.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/api/script/api_test_in_spec.sh b/src/api/script/api_test_in_spec.sh index 0d85e1462e..8ac1c94c5b 100755 --- a/src/api/script/api_test_in_spec.sh +++ b/src/api/script/api_test_in_spec.sh @@ -5,6 +5,7 @@ BASE_DIR=$PWD TEMP_DIR=$BASE_DIR/tmp MYSQL_BASEDIR=$TEMP_DIR/mysql/ MYSQL_DATADIR=$MYSQL_BASEDIR/data +MYSQL_EXTRA_CONF=$TEMP_DIR/my.cnf.add MEMCACHED_PID_FILE=$TEMP_DIR/memcached.pid MYSQL_SOCKET_DIR=`mktemp -d` MYSQL_SOCKET=$MYSQL_SOCKET_DIR/mysql.socket @@ -21,6 +22,11 @@ if [ -z "$MYSQL_SERVER" ]; then exit 1 fi +cat << EOF > $MYSQL_EXTRA_CONF +[mysqld] +plugin-load-add = auth_socket.so +EOF + MEMCACHED_SERVER= for dir in /usr/bin /usr/sbin /usr/libexec; do if [ -x "$dir/memcached" ]; then @@ -54,8 +60,8 @@ kill_memcached() { rm -rf $MYSQL_DATADIR $MYSQL_SOCKET mkdir -p $MYSQL_BASEDIR chown -R $MYSQLD_USER $MYSQL_BASEDIR -mysql_install_db --user=$MYSQLD_USER --datadir=$MYSQL_DATADIR -$MYSQL_SERVER --user=$MYSQLD_USER --datadir=$MYSQL_DATADIR --skip-networking --socket=$MYSQL_SOCKET --pid-file=$TEMP_DIR/mysqld.pid & +mysql_install_db --user=$MYSQLD_USER --datadir=$MYSQL_DATADIR --auth-root-authentication-method=socket --auth-root-socket-user=$MYSQLD_USER --defaults-extra-file=$MYSQL_EXTRA_CONF +$MYSQL_SERVER --defaults-extra-file=$MYSQL_EXTRA_CONF --user=$MYSQLD_USER --datadir=$MYSQL_DATADIR --skip-networking --socket=$MYSQL_SOCKET --pid-file=$TEMP_DIR/mysqld.pid & sleep 2 ##################### api @@ -69,14 +75,14 @@ development: adapter: mysql2 host: localhost database: api_25 - username: root + username: $MYSQLD_USER encoding: utf8 socket: $MYSQL_SOCKET test: adapter: mysql2 host: localhost database: api_test - username: root + username: $MYSQLD_USER encoding: utf8 socket: $MYSQL_SOCKET # disable timeout, required on SLES 11 SP3 at least @@ -90,7 +96,7 @@ $MEMCACHED_SERVER $MEMCACHED_USER -l 127.0.0.1 -d -P $MEMCACHED_PID_FILE || exit export RAILS_ENV=development bundle.ruby2.5 exec rake.ruby2.5 db:create || exit 1 mv db/structure.sql db/structure.sql.git -xzcat test/dump_2.5.sql.xz | mysql -u root --socket=$MYSQL_SOCKET +xzcat test/dump_2.5.sql.xz | mysql -u $MYSQLD_USER --socket=$MYSQL_SOCKET bundle.ruby2.5 exec rake.ruby2.5 db:migrate:with_data db:structure:dump db:drop || exit 1 ./script/compare_structure_sql.sh db/structure.sql.git db/structure.sql || exit 1 @@ -121,7 +127,7 @@ done kill_memcached #cleanup -/usr/bin/mysqladmin -u root --socket=$MYSQL_SOCKET shutdown || true +/usr/bin/mysqladmin -u $MYSQLD_USER --socket=$MYSQL_SOCKET shutdown || true rm -rf $MYSQL_DATADIR $MYSQL_SOCKET_DIR exit 0 -- 2.25.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor