Bug #68183 MySQL mysqld_safe script fails due to new check "if [ ! -e "$err_log" ]"
Submitted: 25 Jan 2013 19:13 Modified: 25 Jan 2013 19:46
Reporter: Stubby Manliness Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.67 and 5.5.29 OS:Solaris (5.10 patch set 2013/01)
Assigned to: CPU Architecture:Any

[25 Jan 2013 19:13] Stubby Manliness
Description:
With MySQL 5.1.67 and 5.5.29 a change was introduced in ./bin/mysqld_safe script and now it fails on Solaris 5.10

mysqld_safe first script line is using the sh shell:
#!/bin/sh

faulty line later on:
if [ ! -e "$err_log" ]; then                  # if error log already exists,
  touch "$err_log"                            # we just append. otherwise,
  chmod "$fmode" "$err_log"                   # fix the permissions here!
fi

For /bin/sh the "-e" is an unsupported test option because Solaris man page for "test":
http://docs.oracle.com/cd/E19253-01/816-5165/6mbb0m9tk/index.html
-e file
    True if file exists. (Not available in sh.)

-f file
    True if file exists and is a regular file. Alternatively, if /usr/bin/sh users specify /usr/ucb before /usr/bin in their PATH environment variable, then test will return true if file exists and is (not-a-directory). The csh test and [ built-ins always use this alternative behavior.

After changing the
   if [ ! -e "$err_log" ]; then
into
   if [ ! -f "$err_log" ]; then
it works agin

How to repeat:
try to start mysql with ./bin/mysqld_safe script

Suggested fix:
It looks like the change was already done according to that entry, but it is not known as new bug id
http://lists.mysql.com/commits/145550

 4133 Nirbhay Choubey	2012-12-27 [merge]
      Merge of patch for Bug#16046140 from mysql-5.1.

    modified:
      scripts/mysqld_safe.sh
 4132 Mattias Jonsson	2012-12-27 [merge]
      merge

-  if [ ! -e "$err_log" ]; then                  # if error log already exists,
+  if [ ! -f "$err_log" ]; then                  # if error log already exists,
[25 Jan 2013 19:46] MySQL Verification Team
Thanks for reporting this. It is a duplicate of bug #67976