Bug 1134032

Summary: mysqld_safe generates errors on sed
Product: Red Hat OpenStack Reporter: Ryan O'Hara <rohara>
Component: mariadb-galeraAssignee: Michael Bayer <mbayer>
Status: CLOSED ERRATA QA Contact: Leonid Natapov <lnatapov>
Severity: low Docs Contact:
Priority: low    
Version: 5.0 (RHEL 7)CC: myllynen, nbarcet, nyechiel, yeylon
Target Milestone: z5Keywords: ZStream
Target Release: 5.0 (RHEL 7)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mariadb-galera-5.5.41-3.el7ost Doc Type: Bug Fix
Doc Text:
Previously, a call to the "sed" command within mysqld_safe.sh which was used to certain command line arguments failed to accommodate arguments which included a slash, such as the paths to the SSL key and certificate files to pass through this function. As a consequence, the mysqld_safe.sh script produced warnings of the form "unknown option to `s'". The script continued to work correctly otherwise as these arguments are not actually needed in this specific context. With this update, the call to sed has been corrected such that the SSL arguments which include slashes are properly interpreted. As a result, the warnings regarding sed are now resolved.
Story Points: ---
Clone Of:
: 1134033 1214904 (view as bug list) Environment:
Last Closed: 2015-09-10 11:45:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1214904    

Description Ryan O'Hara 2014-08-26 16:22:09 UTC
The mysqld_safe script that is used to start mariadb has bad delimeter for sed command in parse_arguments(). When the socket.ssl_cert and socket.ssl_key options are passed, mysqld_safe will generate the following errors:

Aug 26 11:11:31 mesa-virt-18.lab.msp.redhat.com mysqld_safe[23525]: sed: -e expression #1, char 26: unknown option to `s'
Aug 26 11:11:31 mesa-virt-18.lab.msp.redhat.com mysqld_safe[23525]: sed: -e expression #1, char 25: unknown option to `s'

It seems that sed has a problem here since it is using "/" as a delimeter and both socket.ssl_cert and socket.ssl_key take full paths, which of course include "/" characters.

Fix is to simply change:

arg=`echo $arg | sed "s/^$optname/$optname_subst/"`

to

arg=`echo $arg | sed "s|^$optname|$optname_subst|"`

Note that this error seems completely harmless. In my testing, the ssl_cert and ssl_key are set correctly even when the error occurs.

Comment 4 Leonid Natapov 2015-08-31 09:32:58 UTC
mariadb-galera-server-5.5.42-1.el7ost.x86_64.
No errors were generated by mysqld_safe.

Comment 6 errata-xmlrpc 2015-09-10 11:45:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1762.html