ports/182547: [PATCH] databases/mariadb55-server: Respect hier(7) (also affects databases/mariadb55-client)
Michael Gmelin
freebsd at grem.de
Sat Oct 12 11:30:02 UTC 2013
The following reply was made to PR ports/182547; it has been noted by GNATS.
From: Michael Gmelin <freebsd at grem.de>
To: Miroslav Lachman <000.fbsd at quip.cz>
Cc: "bug-followup at FreeBSD.org" <bug-followup at FreeBSD.org>,
Alexandr Kovalenko <never at nevermind.kiev.ua>
Subject: Re: ports/182547: [PATCH] databases/mariadb55-server: Respect hier(7) (also affects databases/mariadb55-client)
Date: Sat, 12 Oct 2013 13:22:33 +0200
> On 12 Oct 2013, at 13:19, Miroslav Lachman <000.fbsd at quip.cz> wrote:
>=20
> Michael Gmelin wrote:
>>=20
>>=20
>>> On 11 Oct 2013, at 18:41, Miroslav Lachman<000.fbsd at quip.cz> wrote:
>>>=20
>>> Michael Gmelin wrote:
>>>>=20
>>>>=20
>>>>> On 11 Oct 2013, at 16:56, Miroslav Lachman<000.fbsd at quip.cz> wrote:
>>>>>=20
>>>>> Michael Gmelin wrote:
>>>>>> On Wed, 02 Oct 2013 21:55:29 +0200
>>>>>> Miroslav Lachman<000.fbsd at quip.cz> wrote:
>>>>>>>=20
>>>>>>> I will test your patch in a few days. I am too busy with my $WORK no=
w.
>>>>>>>=20
>>>>>>> Miroslav Lachman
>>>>>>=20
>>>>>> Did you have a chance to test the patch yet?
>>>>>>=20
>>>>>> Michael
>>>>>=20
>>>>> I tried it right now, but I have a problem. mariadb55-server cannot be=
built on my test machine FreeBSD 9.2-RC4 amd64 GENERIC.
>>>>>=20
>>>>> I always get this error even with original (not patched) version:
>>>>>=20
>>>>> Creating bzip'd tar ball in '/usr/ports/databases/mariadb55-server/wor=
k/mariadb55-server-5.5.33a.tbz'
>>>>> tar: lib/mysql/plugin/auth_pam.so: Cannot stat: No such file or direct=
ory
>>>>> tar: Error exit delayed from previous errors.
>>>>> pkg_create: make_dist: tar command failed with code 256
>>>>>=20
>>>>> I'll investigate it later. I have mariadb55-server-5.5.33a built on 8.=
4 production server, so I don't know why it failed on 9.2-RC4.
>>>=20
>>> I am not able to find a proper fix of the problem with auth_pam.so, so I=
just delete it from pkg-plist. MariaDB works without it.
>>>=20
>>> Tests I did:
>>>=20
>>> 1) start MariaDB with /usr/local/etc/my.cnf
>>> works
>>> 2) start MariaDB with /etc/my.cnf
>>> failed to start [intended]
>>> 3) check my_print_defaults --help
>>> it still prints /etc/ and /etc/mysql/ as right locations for my.cnf
>>> [wrong]
>>>=20
>>> And I have a comment to (2). It prints the error message to a logfile, b=
ut user is not informed about any error with 'service' command.
>>> I think it should be printed to the users console.
>>>=20
>>> I did:
>>>=20
>>> root at sm-reserve ~/# service mysql-server onestart
>>> Starting mysql.
>>>=20
>>> As you can see, 'service' command said "Starting mysql." and no error wa=
s shown, which is really bad. I thought it started with /etc/my.cnf and late=
r found in a logfile, that MariaDB start failed:
>>>=20
>>> root at sm-reserve ~/# tail -f /var/db/mysql/sm-reserve.codelab.cz.err
>>>=20
>>> 131011 18:18:23 mysqld_safe Starting mysqld daemon with databases from /=
var/db/mysql
>>> error: Config file /etc/my.cnf in invalid location, please move to or me=
rge with /usr/local/etc/my.cnf
>>> Fatal error in defaults handling. Program aborted
>>> 131011 18:18:23 mysqld_safe mysqld from pid file /var/db/mysql/sm-reserv=
e.codelab.cz.pid ended
>>>=20
>>> Maybe it is not related to your patch but why 'service' (rc script mysql=
-server) is silent in the case of a failed start?
>>>=20
>>> Miroslav Lachman
>>=20
>> Afaik service mysql always has been silent about errors (eg innodb log fi=
le sizes don't match etc) due to the way the daemon is started, this should b=
e the same with mysql55. I remember missing a warning about innodb not worki=
ng many years ago since it was buried in MySQL error log
>>=20
>> So improving this - also for the MySQL port - would be great, but might b=
e outside of the scope of this PR.
>=20
> So how about this patch to rc.d/mysql-server:
>=20
> --- /usr/local/etc/rc.d/mysql-server.orig 2013-10-11 18:09:34.000000000 +0=
200
> +++ /usr/local/etc/rc.d/mysql-server 2013-10-12 13:12:59.000000000 +020=
0
> @@ -52,6 +52,11 @@
>=20
> mysql_prestart()
> {
> + if [ -f "/etc/my.cnf" -o -f "/etc/mysql/my.cnf" ]; then
> + echo "Please move existing my.cnf file from /etc to /usr/local/et=
c"
> + return 1
> + fi
> +
Maybe make it two checks, so it reports the correct file locations?
>=20
> And are you able to fix my_print_defaults --help to not print /etc/ and /e=
tc/mysql/ as default options directories?
>=20
Should be possible, I will prepare a patch early next week.
Michael=
More information about the freebsd-ports-bugs
mailing list