Bug #56174 mysql.server does not accept any whitespace in option stanzas
Submitted: 22 Aug 2010 23:42 Modified: 24 Aug 2010 14:00
Reporter: Lou Picciano Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.0.67 OS:Solaris (10)
Assigned to: CPU Architecture:Any

[22 Aug 2010 23:42] Lou Picciano
Description:
Weird!

Though my.cnf (other settings files?) accept spaces in option definition lines, the startup script mysql.server does not!

This results in a series of somewhat leading error messages suggesting that paths and files cannot be found...

How to repeat:
# /lib/svc/method/mysql.server start
/lib/svc/method/mysql.server: pid_file: not found
/lib/svc/method/mysql.server: use_mysqld_safe: not found
/lib/svc/method/mysql.server: user: not found
/lib/svc/method/mysql.server: datadir_set: not found
(same is true for several other options settings...)

Suggested fix:
Document - perhaps even within the file itself - that no spaces are permitted in options in this file?
[23 Aug 2010 17:11] Sveta Smirnova
Thank you for the report.

How do you specify options for mysql.server?
[24 Aug 2010 2:44] Lou Picciano
Directly in the script itself, after the section most accommodatingly labeled:

"The following variables are only set for letting mysql.server find things".

As luck would have it, this is precisely what we're trying to do!  All of the file's example options have no spaces, but we made the mistake of trying to do some whitespace formatting.  No Joy!

Seriously, though, this script offers a good basis for a 'method' script within design of a MySQL 'service' under Solaris.  Works very well.
[24 Aug 2010 9:52] Sveta Smirnova
Please send us modified script: I want to see if your modifications conform SHELL scripting rules.
[24 Aug 2010 12:42] Lou Picciano
No need to, really.

Just start from your default mysql.server script, then modify just the line for basedir to include spaces before and after the '=' sign.  This reproduces the problem in our environment.

Shell scripting conventions?  We are using bash 4.1.

Again, to be clear: This may be handled simply as a documentation of this constraint within the script itself.  It's only disorienting because the options syntax in .cnf files DOES accept - and apparently ignores - whitespace.
[24 Aug 2010 13:43] Sveta Smirnova
Thank you for the feedback.

According to http://tldp.org/LDP/abs/html/varassignment.html:

=

    the assignment operator (no space before and after)

So this is expected such syntax does not work for you. No sense to update MySQL documentation too, because if one modifies program file she should be familiar with language syntax. Proper way to change settings for MySQL server is using option files. Closing as "Not a Bug"
[24 Aug 2010 14:00] Lou Picciano
Wow.  Really don't understand that response.  Isn't it in your interest - and in the interest of the next person who might run into this - to simply put one line of documentation reinforcing that spaces are not allowed?  Telling the user he should simply 'know better' doesn't seem very productive or 'forward thinking'...

Again, to be clear: Verbiage in the script itself indicates that it IS a place to change options.  If this is absolutely untrue, then it seems this would be the documentation requirement.

In our case, as we use a variety of disparate media to store different parts of the MySQL environment, we couldn't find a better way to get MySQL, on startup, to begin reading its /usr/local/mysql/my.cnf file, without setting the datadir (/at/another/location) in mysql.server.