Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 233771

Summary: RFE+patch: MySQLd "init.d" startup script should rely on "/usr/bin/my_print_defaults" to get at options
Product: Red Hat Enterprise Linux 4 Reporter: David Tonhofer <bughunt>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED ERRATA QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: byte, hhorak, monty
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: RHSA-2008-0768 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-24 20:04:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Description Flags
The new init script and a diff relative to the old one none

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"

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 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 Product and 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.