The recent addition, on -CURRENT at present, of a ${name}_limits rc_var breaks mysql's rc file. The rc scripts now prepend 'limits -C $_login_class ${name}_limits" to the command line. With the current file, this becomes "limits -C daemon NO su -m mysql ....", which fails with "limits: NO: No such file or directory", because it tries to run the command 'NO'. As a temporary fix, users on CURRENT can delete the : ${mysql_limits="NO"} line from the rc script. The rc file gives an error when it can't find it, but the daemon runs normally. The port could be fixed by removing the limits coding from the rc file if the FreeBSD revision is above 328331
(In reply to robbak from comment #0) Hi, Can you confirm which mysql version exactly you tested on which FreeBSD. The mysql_limits variable isn't new thing that we have added recently. On 'pre-cmd' part it always checks "yesnocheck" if the variable is "NO" it doesn't use it, otherwise it uses it. Maybe I misinterpreted your report, in this case would you elaborate it more please? Thanks :)
(In reply to Mahdi Mokhtari from comment #1) I'm using mysql56-server. The problem started when I upgraded -CURRENT past version 328331, which introduced a ${name}_limits variable to /etc/rc.subr (see https://svnweb.freebsd.org/base/head/etc/rc.subr?view=log). The rc script inserts the contents of that variable into the command line when running the daemon. When ${name}_limits is set to 'NO', this inserts 'NO' to the command line, breaking it.
(In reply to robbak from comment #2) Aha... Thanks for the complete explanation, now I see the point... So basically it's a nameing-conflict after r328331 in the base (-CURRENT). Maybe I should use another name for my "local" limit args in the rc-script... I'm on it :D
Created attachment 190402 [details] Patch for mysql_limit
@robbak, Can you check if this patch fixes the issue for you? [mine seems fine now]
Created attachment 190404 [details] patch-mysql_limit-rc
With this patch mysql56-server starts again :) Thanks for your work!
(In reply to Rainer Hurling from comment #7) Thanks for confirming :) Will commit the fix ASAP.
A commit references this bug: Author: mmokhi Date: Thu Feb 8 12:42:42 UTC 2018 New revision: 461217 URL: https://svnweb.freebsd.org/changeset/ports/461217 Log: databases/mysql56-server: Fix rc-script ${name}_limits conflict for post r328331 After r328331 changes in head/etc/rc.subr, having "NO" in mysql_limits goes into "limits" command params as is. So this patch substitutes the "NO" appropriately when needed. PR: 225657 Reported by: robbak@gmail.com Reviewed by: Rainer Hurling <rhurlin@gwdg.de> Sponsored by: Netzkommune GmbH Changes: head/databases/mysql56-server/Makefile head/databases/mysql56-server/files/mysql-server.in
Committed. Thanks.
Just a heads-up to apply the fix to databases/mysql55-server too.
(In reply to robbak from comment #11) Aha, Yup. I'll open a review for that as well :) [since I'm not maintainer of 55 ``:D].
After updating to -stable today, MySQL doesn't start any more: # service mysql-server start Starting mysql. limits: NO: No such file or directory /usr/local/etc/rc.d/mysql-server: WARNING: failed to start mysql Has this fix been backed out, or is something else necessary? # pkg info mysql56-server mysql56-server-5.6.39_2 Name : mysql56-server Version : 5.6.39_2 Installed on : Sun Apr 8 09:53:31 2018 UTC Origin : databases/mysql56-server Architecture : FreeBSD:11:amd64 Prefix : /usr/local Categories : databases ipv6 Licenses : GPLv2 Maintainer : mmokhi@FreeBSD.org WWW : http://www.mysql.com/ Comment : Multithreaded SQL database (server) Options : ARCHIVE : off BLACKHOLE : off EXAMPLE : off FEDERATED : off INNOBASE : off PARTITION : off PERFSCHEMA : off PERFSCHM : on Annotations : FreeBSD_version: 1101001 cpe : cpe:2.3:a:mysql:mysql:5.6.39:::::freebsd11:x64:2 repo_type : binary repository : FreeBSD Flat size : 82.0MiB Description : MySQL is a very fast, multi-threaded, multi-user and robust SQL (Structured Query Language) database server. WWW: http://www.mysql.com/
Hi, I think it's related to the PR#227230 that we're currently working on. I guess if the src-committers tag the commit mentioned in PR, I can easily edit the condition in the Makefile and issue will be solved.
As a quick workaround, I've set mysql_limits="" in rc.conf; this produces a warning on startup, but lets mysql start up again.
(In reply to stb from comment #15) Yup, That should work fine as well... But at the PR I mentioned we had a cleaner/more-portable way, the only con seems to be that we should tag the _FreeBSD_ on the 11-stable to have the "correct" version for include/exclude the "legacy" limit way.
mysql57-server and mysql80-server also suffer from this limits problem.
(In reply to xxjack12xx from comment #17) Yes, they do, it's not about mysql only, but the base's rc.subr `:) Separate PRs are tracking them :)
The commit in base is reported to be reverted on 11-STABLE. In the PR in SeeAlso: field there's a PR I got it from. The problem is fixed in the patch in mentioned PR :) Thanks from everyone reporter and helped in fix [and sorry for inconvenience you experienced].
Request to open this ticket again. I having the same issue on FreeBSD CURRENT and MariaDB103-server.
Upgraded from 11.2-RELEASE to 12.0-RELEASE on Dec26-2018 and this bug came back. The rc.conf entry "fixes" it, but not be patched for FreeBSD 12.
Same issue here after upgrade to 12.0
After port recompile it doesn't need mysql_limits="" in /etc/rc.conf anymore.