Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 339371 - emerge --config mysql fails on prefix
Summary: emerge --config mysql fails on prefix
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on: 388125
Blocks:
  Show dependency tree
 
Reported: 2010-10-01 17:04 UTC by Thomas Burkard
Modified: 2012-01-07 09:20 UTC (History)
0 users

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


Attachments
patch for the eclass (mysql.eclass-prefix.patch,1.42 KB, patch)
2010-10-01 17:16 UTC, Thomas Burkard
Details | Diff
patch for the eclass (mysql.eclass-prefix.patch,1.23 KB, patch)
2010-11-02 15:04 UTC, Thomas Burkard
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Burkard 2010-10-01 17:04:38 UTC
emerge --config fails for mysql servers in prefix installations. 

mysql_pkg_config in mysql.eclass is assuming that it is run by root which is not necessarily the case with prefix.

Reproducible: Always

Steps to Reproduce:
1. emerge mysql
2. run emerge --config as described by the ebuild
3.

Actual Results:  
you'll see lots of error messages and end up with an unusable(?) database.

Expected Results:  
successfull setup of mysql server
Comment 1 Thomas Burkard 2010-10-01 17:16:29 UTC
Created attachment 249196 [details, diff]
patch for the eclass

this is a patch for the mysql.eclass. it only touches mysql_pkg_config, though the other parts have some issues as well (e.g. several chowns)

the following changes are made:
- filter out a useles chown
- remove a redundant --user which was already filtered for prefix
- set password through mysqladmin instead of mysql client + sql statement
- remove a blank line which was a syntax error (and printed the password to the terminal!)
- add a --user option for the client when setting the zoneinfo


with this patch emerge --config sets up a mysql server i can connect to as user "root"
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-10-08 19:45:04 UTC
(In reply to comment #1)
> Created an attachment (id=249196) [details]
> patch for the eclass
> 
> this is a patch for the mysql.eclass. it only touches mysql_pkg_config, though
> the other parts have some issues as well (e.g. several chowns)
> 
> the following changes are made:
> - filter out a useles chown

fine because you did use prefix ||

> - remove a redundant --user which was already filtered for prefix

Pardon, what does "already filtered" mean?

> - set password through mysqladmin instead of mysql client + sql statement

Why do you need this? It might be ok but I'd like to see Gentoo Linux use this method too

> - remove a blank line which was a syntax error (and printed the password to the
> terminal!)

huh? I have this fix in my sandbox. Sorry, never made it to svn ci i guess...

> - add a --user option for the client when setting the zoneinfo

-uroot is suitable for Gentoo Linux too, right?

> with this patch emerge --config sets up a mysql server i can connect to as user
> "root"
> 

Comment 3 Thomas Burkard 2010-10-08 20:11:30 UTC
(In reply to comment #2)
> > - remove a redundant --user which was already filtered for prefix
> 
> Pardon, what does "already filtered" mean?

--user is set twice, once by an addition to $options and guarded by a 'prefix||' and  once to the call itself. i kept the first occurance because it's already prefix-save, that's what i meant by "filtered".

> > - set password through mysqladmin instead of mysql client + sql statement
> 
> Why do you need this? It might be ok but I'd like to see Gentoo Linux use this
> method too

the other method just didn't work, though i don't exactly recall why atm. iirc you can't connect to the mysql server as db-root without a password if you're not os-root.

> > - add a --user option for the client when setting the zoneinfo
> 
> -uroot is suitable for Gentoo Linux too, right?

i don't know. i don't have a gentoo system at hand for testing...
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-10-20 14:44:33 UTC
whew. I just updated mysql.eclass from gx86...

http://overlays.gentoo.org/proj/alt/changeset/58810

I want to ask you do to two things, please. 1) Test this eclass since the diff is large. 2) rebase your patch, or confirm that it still applies as desired (did not check)

Thanks!
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-10-20 14:48:08 UTC
sorry. misfire. Removing mysql-bugs for now. A Gentoo Prefix diff is coming soon :)
Comment 6 Thomas Burkard 2010-11-02 15:04:06 UTC
Created attachment 252909 [details, diff]
patch for the eclass

i created the patch relative to this eclass:
> # $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.152 2010/10/06 00:13:11 robbat2 Exp $


the changes performed by this patch are:

- filter out a useless chown
- remove a redundant / erroneous "--user" command line option
- set password through mysqladmin instead of mysql client + sql statement

the command to set the password itself seems to work in either version, though the following zoneninfo update fails if the password was not set through mysqladmin, so i assume the two methods are not fully equivalent.

with the original method from the eclass one will receive this message when loading the zoneinfo:
> ERROR 1045: (28000): Access denied for user 'root'@'localhost' (using password: YES)


i had to create this patch on another machine without the possibility to test it... please review carefully!
Comment 7 Fabian Groffen gentoo-dev 2011-11-08 19:39:40 UTC
I fixed this in the eclasses now in Prefix tree
Comment 8 Fabian Groffen gentoo-dev 2012-01-07 09:20:52 UTC
landed in gx86