Hello community,

here is the log from the commit of package opensuse-mariadb-image for 
openSUSE:Factory checked in at 2020-03-01 21:27:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/opensuse-mariadb-image (Old)
 and      /work/SRC/openSUSE:Factory/.opensuse-mariadb-image.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "opensuse-mariadb-image"

Sun Mar  1 21:27:52 2020 rev:7 rq:780382 version:1.0.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/opensuse-mariadb-image/opensuse-mariadb-image.changes
    2020-02-24 15:57:27.852128739 +0100
+++ 
/work/SRC/openSUSE:Factory/.opensuse-mariadb-image.new.26092/opensuse-mariadb-image.changes
 2020-03-01 21:28:18.164591668 +0100
@@ -1,0 +2,11 @@
+Fri Feb 28 21:04:18 UTC 2020 - Thorsten Kukuk <ku...@suse.com>
+
+- Fix parsing of default value output of mysqld
+- Fix init_db call to allow correct setup of database
+
+-------------------------------------------------------------------
+Thu Feb 27 17:59:40 UTC 2020 - Thorsten Kukuk <ku...@suse.com>
+
+- Remove database if init failed
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ opensuse-mariadb-image.kiwi ++++++
--- /var/tmp/diff_new_pack.EWu7ld/_old  2020-03-01 21:28:19.048593463 +0100
+++ /var/tmp/diff_new_pack.EWu7ld/_new  2020-03-01 21:28:19.052593472 +0100
@@ -50,8 +50,8 @@
     <package name="mariadb"/>
     <package name="mariadb-tools"/>
     <package name="timezone"/>
-    <package name="util-linux"/>
-    <package name="pwgen"/>
+    <package name="util-linux"/><!-- su is needed for entrypoint.sh -->
+    <package name="pwgen"/><!-- pwgen is needed for entrypoint.sh -->
     <archive name="entrypoint.tar.gz"/>
   </packages>
 </image>

++++++ config.sh ++++++
--- /var/tmp/diff_new_pack.EWu7ld/_old  2020-03-01 21:28:19.120593609 +0100
+++ /var/tmp/diff_new_pack.EWu7ld/_new  2020-03-01 21:28:19.120593609 +0100
@@ -9,6 +9,8 @@
 echo "Configure image: [$kiwi_iname]..."
 
 # Disable binding to localhost only, doesn't make sense in a container
-sed -i -e 's|\(bind-address.*\)|#\1|g' /etc/my.cnf
+sed -i -e 's|^\(bind-address.*\)|#\1|g' /etc/my.cnf
+# Disable log_error to log to stderr
+sed -i -e 's|^\(log-error.*\)|#\1|g' /etc/my.cnf
 
 exit 0

++++++ entrypoint.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/usr/local/bin/entrypoint.sh 
new/usr/local/bin/entrypoint.sh
--- old/usr/local/bin/entrypoint.sh     2019-10-30 14:37:04.959985381 +0100
+++ new/usr/local/bin/entrypoint.sh     2020-02-28 15:44:09.100510713 +0100
@@ -65,26 +65,9 @@
 # latter only show values present in config files, and not server defaults
 _get_config() {
        local conf="$1"; shift
-       "$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null | awk 
'$1 == "'"$conf"'" { print $2; exit }'
+       "$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null | grep 
^$conf | awk '$1 == "'"$conf"'" { print $2; exit }'
 }
 
-# Read environment files, we may not be allowed to do that after
-# switching the user anymore
-if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
-        # still need to check config, container may have started with --user
-        _check_config "$@"
-        # Get config
-        DATADIR="$(_get_config 'datadir' "$@")"
-
-        if [ ! -d "$DATADIR/mysql" ]; then
-               file_env 'MYSQL_ROOT_PASSWORD'
-               file_env 'MYSQL_ROOT_HOST' '%'
-               file_env 'MYSQL_DATABASE'
-               file_env 'MYSQL_USER'
-               file_env 'MYSQL_PASSWORD'
-       fi
-fi
-
 # allow the container to be started with `--user`
 if [ "$1" = 'mysqld' -a -z "$wantHelp" -a "$(id -u)" = '0' ]; then
        _check_config "$@"
@@ -103,6 +86,7 @@
        DATADIR="$(_get_config 'datadir' "$@")"
 
        if [ ! -d "$DATADIR/mysql" ]; then
+               file_env 'MYSQL_ROOT_PASSWORD'
                if [ -z "$MYSQL_ROOT_PASSWORD" -a -z 
"$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then
                        echo >&2 'error: database is uninitialized and password 
option is not specified '
                        echo >&2 '  You need to specify one of 
MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD'
@@ -110,14 +94,16 @@
                fi
 
                mkdir -p "$DATADIR"
+
                echo 'Initializing database'
-               mysql_install_db --datadir="$DATADIR" --rpm
+               mysql_install_db --datadir="$DATADIR" 
--auth-root-authentication-method=normal --rpm
                echo -n `mysql --version | sed -e 's|.*Distrib 
\(.*\)-MariaDB.*|\1|g' -e 's|\.[0-9]\+$||'` > "$DATADIR"/mysql_upgrade_info
                chmod 640 "$DATADIR/mysql_upgrade_info"
                echo 'Database initialized'
 
                SOCKET="$(_get_config 'socket' "$@")"
-               "$@" --skip-networking --socket="${SOCKET}" &
+               echo "Found socket: $SOCKET"
+               "$@" --verbose --skip-networking --socket="${SOCKET}" &
                pid="$!"
 
                mysql=( mysql --protocol=socket -uroot -hlocalhost 
--socket="${SOCKET}" )
@@ -131,6 +117,7 @@
                done
                if [ "$i" = 0 ]; then
                        echo >&2 'MySQL init process failed.'
+                       rm -rfv "$DATADIR/*"
                        exit 1
                fi
 
@@ -146,6 +133,7 @@
 
                rootCreate=
                # default root to listen for connections from anywhere
+               file_env 'MYSQL_ROOT_HOST' '%'
                if [ ! -z "$MYSQL_ROOT_HOST" -a "$MYSQL_ROOT_HOST" != 
'localhost' ]; then
                        # no, we don't care if read finds a terminating 
character in this heredoc
                        # 
https://unix.stackexchange.com/questions/265149/why-is-set-o-errexit-breaking-this-read-heredoc-expression/265151#265151
@@ -172,11 +160,14 @@
                        mysql+=( -p"${MYSQL_ROOT_PASSWORD}" )
                fi
 
+               file_env 'MYSQL_DATABASE'
                if [ "$MYSQL_DATABASE" ]; then
                        echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` 
;" | "${mysql[@]}"
                        mysql+=( "$MYSQL_DATABASE" )
                fi
 
+               file_env 'MYSQL_USER'
+               file_env 'MYSQL_PASSWORD'
                if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then
                        echo "CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY 
'$MYSQL_PASSWORD' ;" | "${mysql[@]}"
 


Reply via email to