Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 560284 - mysql-multilib.eclass - Breaks access to mysql directory under special condition.
Summary: mysql-multilib.eclass - Breaks access to mysql directory under special condit...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-12 14:41 UTC by Wilson M. Michaels
Modified: 2015-09-14 18:27 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wilson M. Michaels 2015-09-12 14:41:30 UTC
In file mysql-multilib.eclass at lines 801 through 804 contains:

        # Secure the logfiles
        touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err}
        chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql*
        chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql*

In my special case I did "ln -s /var/lib/mysql /var/log" to make the log files shown up in /var/log/mysql.  This probably not a good idea, but I tried it.

Every time I emerged mysql (maridadb) it would fail to start.  The chmod line above prevents mysql from starting because the mysql database directory can not be accessed.  The permissions on the /var/lib/mysql directory (that contains the actual mysql database GRANTS etc.) were changed from 0700 to 0660.  

I know this was caused by my symbolic link, but is is preventable...
Add a "." to the chmod like this:

        chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql.*
                                              ^

so it does not match "mysql"
Comment 1 Brian Evans (RETIRED) gentoo-dev 2015-09-14 18:27:51 UTC
(In reply to Wilson M. Michaels from comment #0)
> In my special case I did "ln -s /var/lib/mysql /var/log" to make the log
> files shown up in /var/log/mysql.  This probably not a good idea, but I
> tried it.
> 
> Every time I emerged mysql (maridadb) it would fail to start.  The chmod
> line above prevents mysql from starting because the mysql database directory
> can not be accessed.  The permissions on the /var/lib/mysql directory (that
> contains the actual mysql database GRANTS etc.) were changed from 0700 to
> 0660.  
> 
If you want to move the logs in your configuration, do so in my.cnf.

Setting a symlink is the wrong thing to do.