Bug 450178

Summary: Somewhat dubious code in mysqld init.d script
Product: Red Hat Enterprise Linux 5 Reporter: David Tonhofer <bughunt>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 5.2CC: artagesw, byte, hhorak, patrickm
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 09:46:23 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:
Attachments:
Description Flags
unified diff on /etc/rc.d/init.d/mysqld none

Description David Tonhofer 2008-06-05 18:23:07 UTC
Description of problem:

The startup configuration of mysqld continues to be a clusterfuck. While this is
going on, awaiting efforts from Sun maybe, we shall endeavour to keep entropy down:

In /etc/rc.d/init.d/mysqld, we see that:

1) datadir is not passed to mysql_install_db even though it might have been
   set in this script
2) socketfile is not passed to mysqladmin even though it might have been
   set in this script
3) user can be configured in /etc/my.cnf, which is useless/dangerous
   because the mysql user is hardcoded in the rc.d script and there is no
   possibility to actually change it from outside. Thus we should pass
   the "user" argument, too.

Tentative diff attached, haven't yet tested it myself.

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

mysql-server-5.0.45-7.el5

Comment 1 David Tonhofer 2008-06-05 18:23:07 UTC
Created attachment 308469 [details]
unified diff on /etc/rc.d/init.d/mysqld

Comment 2 Sam Weiss 2008-06-10 22:54:02 UTC
This bug is more serious than first reported. The init.d/mysqld script is fundamentally broken as it calls 
/usr/bin/my_print_defaults without passing the required first parameter (path to config file). This causes 
the function get_mysql_option() to return no results, so the defaults specified later in the file are always 
used.

This bug should be upgraded to high - it caused my MySQL server to fail to start after upgrading from 5.0 
to 5.1.

Comment 3 Sam Weiss 2008-06-10 22:56:01 UTC
Apologies - typo in my previous comment. This bug  caused my MySQL server to fail to start after 
upgrading from 5.1 to 5.2.

Comment 4 Tom Lane 2008-06-20 01:21:52 UTC
David: agreed on (1); (2) was done already; and as for (3), shouldn't we pull the user option from the 
config file and use that instead of having a hardwired user name?

Sam: what in the world are you talking about?  my_print_defaults doesn't have a "required first parameter", 
and indeed the whole point of using it is to not have this script wire in knowledge about where the config 
file(s) are.

Comment 5 Sam Weiss 2008-06-26 22:32:06 UTC
My apologies... A total red herring. (I have a complicated MySQL config with
multiple instances and multiple config files. Sorry for the confusion.)

Comment 12 errata-xmlrpc 2009-09-02 09:46:23 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-2009-1289.html