RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1069586 - Remove unnecessary pid guessing and include README for included cnf files
Summary: Remove unnecessary pid guessing and include README for included cnf files
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: mariadb
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Honza Horak
QA Contact: Branislav Blaškovič
URL:
Whiteboard:
: 1082018 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-25 10:52 UTC by Levente Farkas
Modified: 2014-08-05 12:56 UTC (History)
6 users (show)

Fixed In Version: mariadb-5.5.35-3.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:59:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (3.37 KB, patch)
2014-02-26 12:25 UTC, Honza Horak
no flags Details | Diff
Proposed patch (3.49 KB, patch)
2014-02-26 14:06 UTC, Honza Horak
no flags Details | Diff
spec file for el6 (36.38 KB, text/x-rpm-spec)
2014-03-05 20:10 UTC, Levente Farkas
no flags Details
updated spec (36.49 KB, text/x-rpm-spec)
2014-03-06 12:50 UTC, Levente Farkas
no flags Details
latest spec (36.50 KB, text/x-rpm-spec)
2014-03-06 14:37 UTC, Levente Farkas
no flags Details

Description Levente Farkas 2014-02-25 10:52:44 UTC
it'd be useful to decided which path to use? ie mysqld or maraidb?

in mariadb-wait-ready script this line :
get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid"
should have to be this:
get_mysql_option mysqld_safe pid-file "/var/run/mariadb/mariadb.pid"
since you create that dir in the spec.

another question that the mariadb.service file should have to add the same pid file as parameter to the mysqld_safe process!

Comment 2 Honza Horak 2014-02-26 09:51:55 UTC
(In reply to Levente Farkas from comment #0)
> it'd be useful to decided which path to use? ie mysqld or maraidb?
> 
> in mariadb-wait-ready script this line :
> get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid"
> should have to be this:
> get_mysql_option mysqld_safe pid-file "/var/run/mariadb/mariadb.pid"
> since you create that dir in the spec.

Right, this is a mistake in that file, but we actually don't need to get pid-file from /etc/my.cnf at all, since we have the daemon pid as the first argument from systemd unit file.

> another question that the mariadb.service file should have to add the same
> pid file as parameter to the mysqld_safe process!

The value pid-file is read by mysqld_safe and passed to mysqld in practice. So this doesn't have to be changed, imho.

Comment 3 Levente Farkas 2014-02-26 10:49:37 UTC
all mistake would be nice to patch sooner or later:-)

at the same time another (imho required) patch would be to patch all /usr/share/mysql/my-*.cnf file and the original /etc/my.cnf too to append this to the end:
-------------------------------
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
-------------------------------
otherwise mysqld_safe pass a wrong argument. this is mentioned in your mariadb-logrotate.patch

anyway this whole mysql - mysqld - mariadb naming mass should have to cleared (probably also the upstream too), but /var/lib/mysql dir and mysql database sharedir, includedir etc... i see the reason of being compatible with mysql but it doesn't seems to be too clear way.

Comment 4 Honza Horak 2014-02-26 11:48:38 UTC
(In reply to Levente Farkas from comment #3)
> at the same time another (imho required) patch would be to patch all
> /usr/share/mysql/my-*.cnf file and the original /etc/my.cnf too to append
> this to the end:
> -------------------------------
> [mysqld_safe]
> log-error=/var/log/mariadb/mariadb.log
> pid-file=/var/run/mariadb/mariadb.pid
> -------------------------------
> otherwise mysqld_safe pass a wrong argument. this is mentioned in your
> mariadb-logrotate.patch

I'd rather add a recommendation of how these files should be correctly used, since it is better not to replace the original my.cnf file, but rather extend it with the configuration from /usr/share/mysql/my-*.cnf files. So, I'd rather add a README file containing:
"""
This directory contains prepared configuration files with .cnf extension,
which provide a configuration for some common MariaDB deployment scenarios.
These configuration files do not include the default configuration of datadir,
log-file and pid-file locations, as specified in the default my.cnf file,
provided in this distribution.

Thus, it is recommended to use these configuration files as an addition to the
default my.cnf configuration file.

Since default my.cnf contains `!includedir /etc/my.cnf.d` directive, it is
recommended to copy required configuration under /etc/my.cnf.d/ directory,
so the default my.cnf specifications will be extended.
"""

Comment 5 Honza Horak 2014-02-26 11:57:42 UTC
The original issue mentioned in comment #0 can lead to an issue, that the server won't be able to start. It can be reproduced by:
1) remove pid-file specification in /etc/my.cnf
2) systemctl start mariadb

Current behaviour:
Server is not started.

Expected behaviour:
Server is started and pid file is in /var/lib/mysql/`hostname`.pid.

Comment 6 Honza Horak 2014-02-26 12:25:11 UTC
Created attachment 867958 [details]
Proposed patch

Proposed patch that adds the README file and removes unnecessary pid guessing

Comment 7 Levente Farkas 2014-02-26 12:53:30 UTC
i don't really like a file to be included/installed twice README.mysql-cnf...

Comment 8 Honza Horak 2014-02-26 14:06:13 UTC
Created attachment 868034 [details]
Proposed patch

(In reply to Levente Farkas from comment #7)
> i don't really like a file to be included/installed twice README.mysql-cnf...

Well, true. The reason for that was that the cnf files have been installed into two locations as well since ages (/usr/share/mysql and /usr/share/doc/mysql-server). So, maybe it would be better to install the .cnf files and README only to /usr/share/mysql as upstream does it.

Comment 12 Levente Farkas 2014-03-05 20:10:24 UTC
Created attachment 871131 [details]
spec file for el6

this is my latest'n'greatest spec for mariadb on rhel6. although it's not for el7 but imho it contains a lot's of bugfix relative to the current one in rhel7 beta.
as rhel7 should have to be able to updated from rhel6 (this's one of the biggest new feature of rhel7 as announced) the maraidb should have to have to be able update rhel6's mysql. of course the systemd <-> upstart differences not relevant to the el7 spec file.

so a few comment:
 * this above is the reason for /var/lib/rpm-state files
 * libmysql version updated to the fedora's one
   * droped libmysql.version, mariadb-versioning.patch, mariadb-dubious-exports.patch
   * added mariadb-versioning-compat.patch
 * a few more new patches
 * pam-devel for auth_pam.so plugin
 * add relevant oboslates
 * add relevant provides
 * mysql_cofig moved from base to devel (as in fedora) and also alternative too
 * path update to 5.5.35
 * run mysql_upgrade since it's required to be able to update from mysql
 * always stop mysql in pre since after mariadb file are installed you're not able to stop or even restart the old mysql serivce
 * add proper chkconfig
 * if mysql was run before update start in posttrans
 * add proper altrenative to the proper scripts section

i hope it will help.

Comment 15 Levente Farkas 2014-03-06 12:50:23 UTC
Created attachment 871417 [details]
updated spec

Comment 17 Levente Farkas 2014-03-06 14:37:51 UTC
Created attachment 871494 [details]
latest spec

Comment 18 Honza Horak 2014-03-06 15:15:45 UTC
(In reply to Levente Farkas from comment #17)
> Created attachment 871494 [details]
> latest spec

Thanks Levente for the proposal, we appreciate that and we're taking that into consideration. However, we won't be able to cover all the issues, like running mysql_upgrade automatically -- we find it too dangerous to do something like that automatically; the configurations can be too different from our expected state. However, users will be instructed to do so on their own.

Comment 20 Levente Farkas 2014-03-06 18:07:57 UTC
in the latest version i also comment it out since if root has password on localhost it's not working.
but most imho the latest spec still has a few fixes to the original ones.

Comment 21 Branislav Blaškovič 2014-03-07 11:27:54 UTC
:: [   LOG    ] :: Package versions:
:: [   LOG    ] ::   mariadb-server-5.5.35-3.el7.x86_64

:: [   LOG    ] :: Doc have to contain README.mysql-cnf
:: [   INFO   ] :: rlRun: command = 'rpm -qld mariadb-server'; exitcode = 0; expected = 0
:: [   PASS   ] :: Running 'rpm -qld mariadb-server' (Expected 0, got 0)
:: [   PASS   ] :: File '/var/tmp/tmp.HfvgoN4CN6' should contain '/usr/share/mysql/README.mysql-cnf' 
:: [   PASS   ] :: Files /root/Tests/mariadb55/Regression/bz1069586-Remove-unnecessary-pid-guessing-and-include-README/README.mysql-cnf and /usr/share/mysql/README.mysql-cnf should not differ 
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 3 good, 0 bad
:: [   PASS   ] :: RESULT: Test


The TC tests the content of file as well now.

Comment 22 Honza Horak 2014-04-08 09:57:37 UTC
*** Bug 1082018 has been marked as a duplicate of this bug. ***

Comment 23 Ludek Smid 2014-06-13 11:59:43 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.