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 235626 - mysqld start script prevents processing of option files
Summary: mysqld start script prevents processing of option files
Keywords:
Status: CLOSED DUPLICATE of bug 233771
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mysql
Version: 4.4
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Tom Lane
QA Contact: David Lawrence
URL: http://dev.mysql.com/doc/refman/4.1/e...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-08 15:01 UTC by monty
Modified: 2013-07-03 03:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-04-08 23:33:48 UTC


Attachments (Terms of Use)

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.



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