Bug 235626

Summary: mysqld start script prevents processing of option files
Product: Red Hat Enterprise Linux 4 Reporter: monty <monty>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED DUPLICATE QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: medium    
Version: 4.4CC: byte, hhorak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://dev.mysql.com/doc/refman/4.1/en/option-files.html
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-08 23:33:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description monty 2007-04-08 15:01:38 UTC
Description of problem:
The /etc/init.d/mysqld script uses the "--defaults-file=/etc/my.cnf" option when starting mysql. 

MySQL reads that option file by default. Specifying that option is not necessary.

Specifying that option prevents MySQL from looking for and processing other option files as specified in 
the MySQL documentation. For example, MySQL will ignore the my.cnf file in /var/lib/mysql/


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

How reproducible:
100%

Steps to Reproduce:
1. Create /var/lib/mysql/my.cnf with various options
2. Start mysqld using /sbin/service mysqld start
3. Run mysql and use the show variables command to look for the options set in /var/lib/mysql/my.cnf
  
Actual results:
None of the options specified in /var/lib/mysql/my.cnf appear in the output of show variables

Expected results:
The options specified in /var/lib/mysql/my.cnf should appear in the output of show variables

Additional info:
MySQL documentation about the processing of option files can be found at http://dev.mysql.com/doc/
refman/4.1/en/option-files.html

Comment 1 Tom Lane 2007-04-08 23:33:48 UTC
The restriction to /etc/my.cnf is intentional because the script itself examines that file; if mysql were to 
look elsewhere then the wrong things would happen.

There is a better way proposed in bug #233771, which I have adopted in CVS HEAD but am unsure when 
or if I will get permission to back-patch into RHEL4.  In the meantime, this is effectively a duplicate of that 
bug and I'm going to mark it as such.

(BTW, surely this is not "high severity".  There's no functionality loss from just putting the options into
/etc/my.cnf, is there?)

*** This bug has been marked as a duplicate of 233771 ***

Comment 2 monty 2007-04-08 23:53:55 UTC
The MySQL documentation specifically states that server specific options should be placed in DATADIR/
my.cnf and that /etc/my.cnf be used for global options. Options in DATADIR/my.cnf override those found 
in /etc/my.cnf

The mysql user/group does not have write permission to /etc/my.cnf

The recent MySQL security update clobbered the /etc/init.d/mysqld file and broke the MySQL functionality 
that was controlled by options set in /var/lib/my.cnf




Comment 3 monty 2007-04-09 04:41:49 UTC
The output of running

my_print_defaults client mysqld

shows that the contents of /var/lib/mysql/my.cnf would be processed by mysqld as expected.

The use of [--defaults-file=/etc/my.cnf"] in /etc/init.d/mysqld breaks the expected behavior.