Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 672518

Summary: dev-db/mysql-5.7.24 - pkg_config() fails to write lockfile due to permissions on /var/run/mysqld
Product: Gentoo Linux Reporter: matoro <matoro_gentoo>
Component: Current packagesAssignee: Gentoo Linux MySQL bugs team <mysql-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info

Description matoro archtester 2018-12-04 18:43:35 UTC
Created attachment 557088 [details]
emerge --info

On a fresh install of =dev-db/mysql-5.7.24, running emerge --config fails due to root:root 755 perms on /var/run/mysqld.  Changing ownership to mysql:mysql fixes the issue as described here:  https://stackoverflow.com/questions/34954455.

I see the following in mysql-5.7.24.ebuild:

# Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
PID_DIR="${EROOT%/}/var/run/mysqld"
if [[ ! -d "${PID_DIR}" ]] ; then
    install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory"
fi

which may suggest that the directory is somehow created before the check for its existence, and the install command is never run.  A check for correct perms in addition to existence may be the solution, though I have not tested that yet.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2019-08-17 13:53:18 UTC
>=dev-db/mysql-8 will check for that and _report_ the problem (https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-db/mysql/mysql-8.0.17.ebuild?id=62c4958c9adbc445838f5bb533ead2f75b22413e#n680). However, we will never adjust permission because we can't know if administrator has set this permission on purpose...

No plans to backport this to <mysql-8.