Bug #44666 Documentation of mysqld_safe is inexact about options
Submitted: 5 May 2009 11:34 Modified: 14 May 2009 19:37
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.1, 6.0 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[5 May 2009 11:34] Guilhem Bichot
Description:
mysqld_safe is identical between 5.1 and 6.0.
http://dev.mysql.com/doc/refman/6.0/en/mysqld-safe.html says
"All options specified to mysqld_safe on the command line are passed to mysqld. If you want to use any options that are specific to mysqld_safe and that mysqld doesn't support, do not specify them on the command line. Instead, list them in the [mysqld_safe] group of an option file".

The first sentence is wrong. For example those options are handled by mysqld_safe and not passed to mysqld:
--core-file-size --ledir --mysqld --mysqld-version --nice --skip-kill-mysqld  --syslog --skip-syslog --syslog-tag

So the advice given in the second sentence is wrong; you can put those mysqld_safe-specific options on the mysqld_safe command line, it will cause no problem (I checked with "mysqld_safe --nice=10", it works).

mysqld_safe passes options to mysqld only if they are unknown to mysqld_safe (like, --skip-grant-tables) _and_ they are on the command-line.
If the unknown option is put in [mysqld_safe] in the configuration file, the option is silently sent to /dev/null by mysqld_safe.
Not so intuitive. If you think it's inconsistent, I'm fine with making a new bug report for mysqld_safe this time.

How to repeat:
read the doc.
[14 May 2009 18:26] Paul DuBois
Guilhem, so it's like this?

Options unknown to mysqld_safe are passed to mysqld if they are specified on the command line, but ignored if they are specified in the [mysqld_safe] group of an option file.
[14 May 2009 19:16] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

Note: This behavior occurs in 4.1/5.0 as well.
[14 May 2009 19:25] Guilhem Bichot
Hi Paul; from looking at the code I confirm this, and from testing, too. I put this in /etc/mysql/my.cnf (default config file on Ubuntu 8.10):
[mysqld_safe]
unk-to-mysqld-safe-in-my-cnf
Then I ran:
sh -x ./scripts/mysqld_safe --unk-to-mysqld-safe-in-cmd-line
and this prints that the invokation of mysqld is:
nohup ./sql/mysqld --unk-to-mysqld-safe-in-cmd-line (other options like --log-error)
So, --unk-to-mysqld-safe-in-cmd-line is passed but unk-to-mysqld-safe-in-my-cnf goes to /dev/null. Using 6.0.
[28 Dec 2009 19:41] Don Cohen
If you think the doc makes it clear what options belong in what section of my.cnf then I disagree.  I saw log-error in [mysqld_safe] and thought that was therefore a reasonable place to put general-log - didn't work.
I suggest that the initial version of my.cnf under the [mysqld_safe] section 
describe what options DO have some effect there, and state that others meant to affect the server belong under [mysqld]

BTW, I don't see general-log-file at all in http://dev.mysql.com/doc/refman/5.1/en/server-options.html
Also it appears that hyphens and underscores are interchangeable in the config file - is this generally true?
Is it mentioned anywhere in the doc?  

But of course, these are off the original topic.