Bug 233771 - RFE+patch: MySQLd "init.d" startup script should rely on "/usr/bin/my_print_defaults" to get at options
RFE+patch: MySQLd "init.d" startup script should rely on "/usr/bin/my_print_d...
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mysql (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
David Lawrence
: 235626 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2007-03-24 16:59 EDT by David Tonhofer
Modified: 2013-07-02 23:12 EDT (History)
3 users (show)

See Also:
Fixed In Version: RHSA-2008-0768
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-07-24 16:04:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description David Tonhofer 2007-03-24 16:59:16 EDT
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"

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):


Also see bug #194596, which applies to Fedora though.
Comment 1 David Tonhofer 2007-03-24 16:59:16 EDT
Created attachment 150835 [details]
The new init script and a diff relative to the old one
Comment 2 David Tonhofer 2007-03-24 18:42:55 EDT
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 19:34:01 EDT
*** Bug 235626 has been marked as a duplicate of this bug. ***
Comment 4 monty 2007-04-09 00:40:28 EDT
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 Product and Program Management 2008-02-01 14:09:18 EST
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 16:47:44 EDT
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 16:04:22 EDT
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.


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