Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685822 - dev-db/mariadb: --config fails if tmpdir is defined multiple times
Summary: dev-db/mariadb: --config fails if tmpdir is defined multiple times
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-13 12:16 UTC by Steven Dürl
Modified: 2019-05-13 19:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Suggested patch (tmpdir-fix.patch,497 bytes, patch)
2019-05-13 12:16 UTC, Steven Dürl
Details | Diff
emerge --config dev-db/mariadb (emerge-config.log,2.02 KB, text/x-log)
2019-05-13 12:17 UTC, Steven Dürl
Details
mysql_install_db.log generated by ebuild (mysql_install_db.log,1.29 KB, text/x-log)
2019-05-13 12:17 UTC, Steven Dürl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Dürl 2019-05-13 12:16:12 UTC
Created attachment 576418 [details, diff]
Suggested patch

Since MariaDB 10.2 the default config includes /etc/mysql/mariadb.d/*.cnf. To get rid of overwriting the distributed default configs /etc/mysql/mariadb.d/50-distro-*.cnf, we've created a "local" config /etc/mysql/mariadb.d/80-local.cnf which gets distributed to our servers.

Within 80-local.cnf we define "tmpdir = /var/lib/mysql_tmp". MariaDB/mysqld only respects the last defined tmpdir option but my_print_defaults prints both.

Because of this MYSQL_TMPDIR stores "/tmp/\n/var/lib/mysql_tmp". Note the newline between /tmp/ and /var/lib/mysql_tmp.

Later the cmd for mysql_install_db gets constructed with MYSQL_TMPDIR which causes $cmd to hold two commands. $cmd is then passed to 'su /bin/sh -c "${cmd[*]}" mysql' which will execute mysql_install_db [args...] and /var/lib/mysql_tmp. This will then fail with "sh: line 1: /var/lib/mysql_tmp: Is a directory".
Comment 1 Steven Dürl 2019-05-13 12:17:10 UTC
Created attachment 576420 [details]
emerge --config dev-db/mariadb

Note the /var/lib/mysql_tmp below the actual command line for mysql_install_db
Comment 2 Steven Dürl 2019-05-13 12:17:55 UTC
Created attachment 576422 [details]
mysql_install_db.log generated by ebuild
Comment 3 Larry the Git Cow gentoo-dev 2019-05-13 19:04:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61d7e42e3601a71418cbcdd11e40e3441a0ae8a7

commit 61d7e42e3601a71418cbcdd11e40e3441a0ae8a7
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2019-05-13 19:00:27 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2019-05-13 19:04:23 +0000

    dev-db/mariadb: Fix pkg_config issues when multiple values exist
    
    Closes: https://bugs.gentoo.org/685822
    Package-Manager: Portage-2.3.66, Repoman-2.3.12
    Signed-off-by: Brian Evans <grknight@gentoo.org>

 dev-db/mariadb/mariadb-10.2.22-r1.ebuild | 6 +++---
 dev-db/mariadb/mariadb-10.2.24.ebuild    | 2 +-
 dev-db/mariadb/mariadb-10.3.13.ebuild    | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=561ed0ab80220deff0205463ce2e10c7536309eb

commit 561ed0ab80220deff0205463ce2e10c7536309eb
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2019-05-13 18:27:37 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2019-05-13 19:04:22 +0000

    dev-db/mariadb: Version bump for 10.2.24
    
    Closes: https://bugs.gentoo.org/show_bug.cgi?id=682566
    Bug: https://bugs.gentoo.org/685822
    Package-Manager: Portage-2.3.66, Repoman-2.3.12
    Signed-off-by: Brian Evans <grknight@gentoo.org>

 dev-db/mariadb/Manifest               |   1 +
 dev-db/mariadb/mariadb-10.2.24.ebuild | 972 ++++++++++++++++++++++++++++++++++
 2 files changed, 973 insertions(+)