The init script tries to do, local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1) which doesn't work if you set "pid_file" (with an underscore) in my.cnf. The version with the underscore is what appears in the MySQL/MariaDB online documentation. Unrelated: if I were you, I would completely ignore the PID path from my.cnf. The PID file falls under the purview of the init system, who is in charge of setting up the correct permissions and everything else. If a user changes the path in my.cnf, he's going to get a bad surprise when you start calling "chown" on random directories on his system. Not that there's any reason to change it anyway. Force it via the command-line to go in "/run/${RC_SVCNAME}/${RC_SVCNAME}.pid" and be done with it =)
(In reply to Michael Orlitzky from comment #0) > The init script tries to do, > > local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1) > > which doesn't work if you set "pid_file" (with an underscore) in my.cnf. The > version with the underscore is what appears in the MySQL/MariaDB online > documentation. > We provide a pid-file line in 50-distro-server.cnf which is meant to be included by the user. They are notified about this integration in the elog. What people have to understand is that underscores are "variables" and hyphens are "command options". Yes I know it is confusing but both of these options are valid and we've been using pid-file for a long, long time now. > > Unrelated: if I were you, I would completely ignore the PID path from > my.cnf. The PID file falls under the purview of the init system, who is in > charge of setting up the correct permissions and everything else. If a user > changes the path in my.cnf, he's going to get a bad surprise when you start > calling "chown" on random directories on his system. Not that there's any > reason to change it anyway. Force it via the command-line to go in > "/run/${RC_SVCNAME}/${RC_SVCNAME}.pid" and be done with it =) As seen in bug 678272, we need a consistent resource in the configuration such that logrotate scripts work to HUP the server. The only alternative to this is to radically change 'root'@'localhost' like other distros and eliminate password authentication and rely on UNIX user auth instead.
(In reply to Brian Evans from comment #1) > > We provide a pid-file line in 50-distro-server.cnf which is meant to be > included by the user. They are notified about this integration in the elog. Fair enough, I did indeed change the existing entry. But I did so based on the MariaDB docs, and to make it match the style of the other my.cnf parameters that I have set. > > Not that there's any > > reason to change it anyway. Force it via the command-line to go in > > "/run/${RC_SVCNAME}/${RC_SVCNAME}.pid" and be done with it =) > > As seen in bug 678272, we need a consistent resource in the configuration > such that logrotate scripts work to HUP the server. > That's... exactly why I'm suggesting that you hard-code the PID file path in the init script. If the user changes it in my.cnf, everything breaks anyway. You can pass --pid-file to the daemon so that the my.cnf value is ignored. That fixes, * this bug * bug 678272 * the security bug that someone is going to file when he tries to relocate his pid file to /run and finds /run owned by "mysql" and it simplifies the init script (because you no longer need to parse that value).
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29f98d49b8679417fe873aefb9182a43f2bafca4 commit 29f98d49b8679417fe873aefb9182a43f2bafca4 Author: Brian Evans <grknight@gentoo.org> AuthorDate: 2019-03-05 21:27:48 +0000 Commit: Brian Evans <grknight@gentoo.org> CommitDate: 2019-03-05 21:27:48 +0000 dev-db/mysql-init-scripts: Fix up pid file searching Changed how the pid file is searched for in both logrotate and init Closes: https://bugs.gentoo.org/677396 Closes: https://bugs.gentoo.org/678272 Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Brian Evans <grknight@gentoo.org> dev-db/mysql-init-scripts/files/init.d-2.3 | 194 +++++++++++++++++++++ dev-db/mysql-init-scripts/files/init.d-s6-2.3 | 163 +++++++++++++++++ .../mysql-init-scripts/files/init.d-supervise-2.3 | 180 +++++++++++++++++++ .../mysql-init-scripts/files/logrotate.mysql-2.3 | 14 ++ .../mysql-init-scripts-2.3.ebuild | 67 +++++++ 5 files changed, 618 insertions(+)