Bug #9852 msyql.server: alias command not available in Solaris /bin/sh
Submitted: 12 Apr 2005 17:45 Modified: 25 Apr 2005 19:26
Reporter: Adam Arrowood Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:4.1.11 OS:Solaris (Solaris 2.9)
Assigned to: Jim Winstead CPU Architecture:Any

[12 Apr 2005 17:45] Adam Arrowood
Description:
In the support-script, mysql.server, which is a /bin/sh script, there are the lines:

#
# Use LSB init script functions for printing messages, if possible
#
lsb_functions="/lib/lsb/init-functions"
if test -f $lsb_functions ; then
  source $lsb_functions
else
  alias log_success_msg="echo \ SUCCESS! "
  alias log_failure_msg="echo \ ERROR! "
fi

In Solaris 2.9 (and other versions??), there are no LSB functions and there is no 'alias' function in /bin/sh. There is a /usr/bin/alias command, but it only works with csh and ksh, not sh.

How to repeat:
1) install a standard 4.1.11 mysql package, install default databases
2) run mysql.server
3) notice the error:
   log_success_msg: not found

Suggested fix:
either change the script to csh or ksh (in my case I used /usr/bin/ksh)

or 

don't use alias, write it some other way (TM)
[13 Apr 2005 21:57] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23995
[15 Apr 2005 0:22] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24033
[25 Apr 2005 19:05] Jim Winstead
Fixed in 4.1.12 and 5.0.4.
[25 Apr 2005 19:26] Paul Dubois
Noted in 4.1.12, 5.0.4 changelogs.