diff options
author | Shishir Jaiswal <shishir.j.jaiswal@oracle.com> | 2017-01-31 11:53:42 +0530 |
---|---|---|
committer | Shishir Jaiswal <shishir.j.jaiswal@oracle.com> | 2017-01-31 11:53:42 +0530 |
commit | df6e0160a4c3414d207020c0a1cfc8f79d1ea7bc (patch) | |
tree | da6403c16175f3c095f6ad867750039ab004944a /packaging | |
parent | 35809da2077e913eda7da75aec674593c74238af (diff) | |
download | mariadb-git-df6e0160a4c3414d207020c0a1cfc8f79d1ea7bc.tar.gz |
Bug#24619033 - UNABLE TO START MYSQLD DUE TO CHANGES IN
MYSQLD_SAFE
DESCRIPTION
===========
Starting a mysql server by running init script:
/etc/init.d/mysqld start
is failing. This is happening after the changes done in
script 'mysqld_safe' as a patch to Bug#24464380.
ANALYSIS
========
Say customer's /etc/my.cnf has following content:
[mysqld_safe]
.
.
ledir = /mysqld_ledir
mysqld = mysqld_wrapper
Patch to Bug#24464380 prohibits using "mysqld" (and few
other variables) in config file due to privilege reasons.
Since mysqld init scripts internally calls 'mysqld_safe'
script, the existing configuration has started failing.
FIX
===
In the init script, we now pass MYSQLD_OPTS as the first
argument (expected to be read from /etc/sysconfig/mysqld)
to mysqld_safe command. This new variable can have all the
mysqld_safe's special options as a string containing command
line arguments. For example:
MYSQLD_OPTS=" --ledir=/mysqld_ledir --mysqld=my_wrapper "
NOTE TO THE DOCUMENTATION TEAM
==============================
As mentioned above, the prohibited variables have to be
moved from /etc/my.cnf to /etc/sysconfig/mysqld as a string
containing command-line arguments in the form of variable
MYSQLD_OPTS. We can pass mysqld options as well in this new
variable which would be further passed to mysqld process.
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/rpm-oel/mysql.init | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packaging/rpm-oel/mysql.init b/packaging/rpm-oel/mysql.init index c3bbb277b91..108da1dcd26 100644 --- a/packaging/rpm-oel/mysql.init +++ b/packaging/rpm-oel/mysql.init @@ -23,6 +23,9 @@ prog="mysqld" STARTTIMEOUT=120 STOPTIMEOUT=60 +# Set in /etc/sysconfig/mysqld, will be passed to mysqld_safe +MYSQLD_OPTS= + [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog lockfile=/var/lock/subsys/$prog @@ -110,7 +113,7 @@ start(){ # and some users might prefer to configure logging to syslog.) # Note: set --basedir to prevent probes that might trigger SELinux # alarms, per bug #547485 - $exec --datadir="$datadir" --socket="$socketfile" \ + $exec $MYSQLD_OPTS --datadir="$datadir" --socket="$socketfile" \ --pid-file="$mypidfile" \ --basedir=/usr --user=mysql >/dev/null & safe_pid=$! |