Bug 233771 - RFE+patch: MySQLd "init.d" startup script should rely on "/usr/bin/my_print_defaults" to get at options
Summary: RFE+patch: MySQLd "init.d" startup script should rely on "/usr/bin/my_print_d...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mysql
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Tom Lane
QA Contact: David Lawrence
URL:
Whiteboard:
: 235626 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-03-24 20:59 UTC by David Tonhofer
Modified: 2013-07-03 03:12 UTC (History)
3 users (show)

Fixed In Version: RHSA-2008-0768
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-07-24 20:04:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
The new init script and a diff relative to the old one (10.75 KB, text/plain)
2007-03-24 20:59 UTC, David Tonhofer
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2008:0768 0 normal SHIPPED_LIVE Moderate: mysql security, bug fix, and enhancement update 2008-07-24 17:12:22 UTC

Description David Tonhofer 2007-03-24 20:59:16 UTC
Description of problem:

This is of course just my "opionion", however it would seem advantageous to
employ MySQL's packaged tools to get at MySQL options (which we have to
know about before actually starting MySQL server) instead of additional
sed-based extraction. 

MySQL option handling is already confusing enough - let's not add to it.

In this spirit, I have attached a modified init.d script that gets options
from my.cnf using "my_print_defaults", as is done in the MySQL "mysqld_safe"
script. 

As a side note, "my_print_defaults" seems to miss the following features:

  1) Set the path of my.cnf files to check. Currently this is compiled-in,
     which is not too flexible. Like this:

     my_print_defaults --search=/etc/my.cnf:/var/lib/mysql/my.cnf:$HOME/.my.cnf

  2) Concatenate the options of several my.cnf sections in a single stream,
     in a specific order. Rendered necessary as the sections seem to change
     names depending on the version. Like this:

     my_print_defaults --sections=mysqld:mysql.server:mysqld_safe

But that is another story. 

Version-Release number of selected component (if applicable):

mysql-server-4.1.20-1.RHEL4.1

Also see bug #194596, which applies to Fedora though.

Comment 1 David Tonhofer 2007-03-24 20:59:16 UTC
Created attachment 150835 [details]
The new init script and a diff relative to the old one

Comment 2 David Tonhofer 2007-03-24 22:42:55 UTC
Cough! I guess the script should not try to get data from
section "[mysql.server]", even if such a section exists in the
delivered "my.cnf"; mysqld_safe does not seem to read from it.
Exclusively use section "[mysqld]" instead.

And do not try to set "basedir" in "my.cnf" either or terrible
things happen :-/ Instead let mysqld_safe find it by itself and
set it to "--basedir=/usr"


Comment 3 Tom Lane 2007-04-08 23:34:01 UTC
*** Bug 235626 has been marked as a duplicate of this bug. ***

Comment 4 monty 2007-04-09 04:40:28 UTC
The "--defaults-file="/etc/my.cnf"" option should not be used in the start script. It prevents mysqld from 
reading the other option files. See comments in Bug 235626.


Comment 6 RHEL Program Management 2008-02-01 19:09:18 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 8 monty 2008-04-28 20:47:44 UTC
The rpm package is not well-behaved. It clobbers the /etc/init.d/mysqld file if it had been modified. 

Comment 13 errata-xmlrpc 2008-07-24 20:04:22 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2008-0768.html


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