Bug 450178 - Somewhat dubious code in mysqld init.d script
Somewhat dubious code in mysqld init.d script
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: mysql (Show other bugs)
All Linux
low Severity low
: rc
: ---
Assigned To: Tom Lane
Depends On:
  Show dependency treegraph
Reported: 2008-06-05 14:23 EDT by David Tonhofer
Modified: 2013-07-02 23:18 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-02 05:46:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
unified diff on /etc/rc.d/init.d/mysqld (1.70 KB, patch)
2008-06-05 14:23 EDT, David Tonhofer
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1289 normal SHIPPED_LIVE Moderate: mysql security and bug fix update 2009-09-01 09:32:14 EDT

  None (edit)
Description David Tonhofer 2008-06-05 14:23:07 EDT
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):

Comment 1 David Tonhofer 2008-06-05 14:23:07 EDT
Created attachment 308469 [details]
unified diff on /etc/rc.d/init.d/mysqld
Comment 2 Sam Weiss 2008-06-10 18:54:02 EDT
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 

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 18:56:01 EDT
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-19 21:21:52 EDT
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 18:32:06 EDT
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 05:46:23 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.