| Summary: | dev-db/mysql-init-scripts: fails to set correct permissions on /var/run/mysqld | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | pva <peter.volkov> |
| Component: | Current packages | Assignee: | Gentoo Linux MySQL bugs team <mysql-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | hydrapolic |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
emerge --info dev-db/mariadb
output of rm /run/mysql && emerge mysq-init-scripts |
||
|
Description
pva
2019-08-28 09:29:30 UTC
I've tested stable branch: =dev-db/mariadb-10.2.22-r1 =dev-db/mysql-init-scripts-2.3 but after reading ebuild I thinks this error exists in ~arch too. BTW, may be we should not create directories in /var/run/ in ebuild at all... Why mysql-init-scripts does this? Your conclusion is invalid: Yes, we are using tmpfiles service which is supported in systemd *and* OpenRC world to manage /run/mysqld directory. But this will only work if the directory doesn't exist yet. So it looks like /run/mysqld already existed with invalid permissions. In this case we are not going to do anything because we assume "you" know better... In >=dev-db/mysql-8 we added a permission check to show a better error message to allow user to understand why --config failed: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-db/mysql/mysql-8.0.17.ebuild?id=7d192490e75a8b42632128c1c7a6b0c918331f52#n684 Maybe we will backport this to mariadb, too. But we will never fix permissions for user because we can't know why something is set this way and if it's desired to change... Well, take a look yourself:
1. I'm removing /var/run/mysqld
2. I run emerge dev-db/mysql-init-scripts
3. Dirrectory is in place with wrong owner.
b612-dev3-stage4 ~ # rm -rf /var/run/mysqld/
b612-dev3-stage4 ~ # emerge dev-db/mysql-init-scripts
...
>>> Installing (1 of 1) dev-db/mysql-init-scripts-2.3::gentoo
chown: неверный пользователь: «mysql»
chgrp: неверная группа: «mysql»
...
b612-dev3-stage4 ~ # ls -dla /var/run/mysqld
drwxr-xr-x 2 root root 40 авг 28 10:26 /var/run/mysqld
I'll attach full output.
Created attachment 588412 [details]
output of rm /run/mysql && emerge mysq-init-scripts
I cannot tell you why you are seeing this, but this is not normal. So you are doing something wrong or have something special, see:
> (chroot) dev1 / # ls -lv /run/
> total 0
>
> (chroot) dev1 / # emerge -a1 --usepkg=n --nodeps '=dev-db/mysql-init-scripts-2.3'
>
> These are the packages that would be merged, in order:
>
> [ebuild N ] dev-db/mysql-init-scripts-2.3::gentoo 0 KiB
>
> Total: 1 package (1 new), Size of downloads: 0 KiB
>
> Would you like to merge these packages? [Yes/No] y
>
> >>> Verifying ebuild manifests
>
> >>> Emerging (1 of 1) dev-db/mysql-init-scripts-2.3::gentoo
> >>> Unpacking source...
> >>> Source unpacked in /var/tmp/portage/dev-db/mysql-init-scripts-2.3/work
> >>> Preparing source in /var/tmp/portage/dev-db/mysql-init-scripts-2.3/work ...
> >>> Source prepared.
> >>> Configuring source in /var/tmp/portage/dev-db/mysql-init-scripts-2.3/work ...
> >>> Source configured.
> >>> Compiling source in /var/tmp/portage/dev-db/mysql-init-scripts-2.3/work ...
> >>> Source compiled.
> >>> Test phase [not enabled]: dev-db/mysql-init-scripts-2.3
>
> >>> Install dev-db/mysql-init-scripts-2.3 into /var/tmp/portage/dev-db/mysql-init-scripts-2.3/image/
> >>> Completed installing dev-db/mysql-init-scripts-2.3 into /var/tmp/portage/dev-db/mysql-init-scripts-2.3/image/
>
> * Final size of build directory: 0 KiB
> * Final size of installed tree: 60 KiB
>
> ./
> ./etc/
> ./etc/conf.d/
> ./etc/conf.d/mysql
> ./etc/conf.d/mysql-s6
> ./etc/init.d/
> ./etc/init.d/mysql-s6
> ./etc/init.d/mysql
> ./etc/init.d/mysql-supervise
> ./etc/logrotate.d/
> ./etc/logrotate.d/mysql
> ./var/
> ./var/svc.d/
> ./var/svc.d/mysql/
> ./var/svc.d/mysql/run
> ./var/svc.d/mysql/log/
> ./var/svc.d/mysql/log/run
> ./usr/
> ./usr/libexec/
> ./usr/libexec/mysqld-wait-ready
> ./usr/lib/
> ./usr/lib/tmpfiles.d/
> ./usr/lib/tmpfiles.d/mysql.conf
> ./lib/
> ./lib/systemd/
> ./lib/systemd/system/
> ./lib/systemd/system/mysqld.service
> ./lib/systemd/system/mysqld@.service
> >>> Done.
>
> >>> Installing (1 of 1) dev-db/mysql-init-scripts-2.3::gentoo
> * checking 12 files for package collisions
> >>> Merging dev-db/mysql-init-scripts-2.3 to /
> --- /lib/
> --- /lib/systemd/
> --- /lib/systemd/system/
> >>> /lib/systemd/system/mysqld@.service
> >>> /lib/systemd/system/mysqld.service
> --- /usr/
> --- /usr/lib/
> --- /usr/lib/tmpfiles.d/
> >>> /usr/lib/tmpfiles.d/mysql.conf
> --- /usr/libexec/
> >>> /usr/libexec/mysqld-wait-ready
> --- /var/
> >>> /var/svc.d/
> >>> /var/svc.d/mysql/
> >>> /var/svc.d/mysql/log/
> >>> /var/svc.d/mysql/log/run
> >>> /var/svc.d/mysql/run
> --- /etc/
> --- /etc/logrotate.d/
> >>> /etc/logrotate.d/mysql
> --- /etc/init.d/
> >>> /etc/init.d/mysql-supervise
> >>> /etc/init.d/mysql
> >>> /etc/init.d/mysql-s6
> --- /etc/conf.d/
> >>> /etc/conf.d/mysql-s6
> >>> /etc/conf.d/mysql
> *
> * To use the mysql-s6 script, you need to install the optional sys-apps/s6 package.
> * If you wish to use s6 logging support, comment out the log-error setting in your my.cnf
> *
> * Starting with version 10.1.8, MariaDB includes an improved systemd unit named mariadb.service
> * You should prefer that unit over this package's mysqld.service.
> *
> >>> dev-db/mysql-init-scripts-2.3 merged.
> >>> Regenerating /etc/ld.so.cache...
>
> * Messages for package dev-db/mysql-init-scripts-2.3:
>
> *
> * To use the mysql-s6 script, you need to install the optional sys-apps/s6 package.
> * If you wish to use s6 logging support, comment out the log-error setting in your my.cnf
> *
> * Starting with version 10.1.8, MariaDB includes an improved systemd unit named mariadb.service
> * You should prefer that unit over this package's mysqld.service.
> >>> Auto-cleaning packages...
>
> >>> No outdated packages were found on your system.
>
> * GNU info directory index is up-to-date.
> (chroot) dev1 / # ls -lv /run
> total 0
> drwxr-xr-x 2 mysql mysql 6 Aug 28 12:23 mysqld
(In reply to Thomas Deutschmann from comment #6) > I cannot tell you why you are seeing this, but this is not normal. So you > are doing something wrong or have something special, see: > > > (chroot) dev1 / # ls -lv /run ... > > (chroot) dev1 / # ls -lv /run > > total 0 > > drwxr-xr-x 2 mysql mysql 6 Aug 28 12:23 mysqld Could you, please, remove mysql user/group from the system. I'm sure this will help to reproduce this problem. Plase, note, that mysql-init-scripts are merged before mariadb, where this user/group is used. The problem is that dev-db/mysql-init-scripts uses mysql user/group but doesn't depend on acct-{user,group}/mysql.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c61d964bfc659eb2a8474552853311a2b1d8503 commit 5c61d964bfc659eb2a8474552853311a2b1d8503 Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2019-08-28 11:34:23 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2019-08-28 11:38:14 +0000 dev-db/mysql-init-scripts: package requires acct-{user,group}/mysql ...already in pkg_post* phase. Bug: https://bugs.gentoo.org/693000 Package-Manager: Portage-2.3.72, Repoman-2.3.17 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> .../mysql-init-scripts-2.3-r2.ebuild | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) I saw this too and it wasn't immediatelly visible what's wrong. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cda4995e825424bf017dc4a76e249d0531f841d4 commit cda4995e825424bf017dc4a76e249d0531f841d4 Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2019-08-28 14:17:49 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2019-08-28 14:43:21 +0000 dev-db/mysql-init-scripts: rev bump - Move acct-* dependencies to RDEPEND to support binary packages. Note: According to devmanual there will be a problem once emerge will merge RDEPEND after the actual package. - Handle the case when option is defined multiple times. Closes: https://bugs.gentoo.org/693000 Closes: https://bugs.gentoo.org/686378 Package-Manager: Portage-2.3.72, Repoman-2.3.17 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> .../mysql-init-scripts/files/logrotate.mysql-2.3 | 5 +- .../mysql-init-scripts-2.3-r3.ebuild | 70 ++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) |