summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-04-11 10:18:04 -0400
committerSergei Golubchik <serg@mariadb.org>2017-04-11 10:18:04 -0400
commit663068c6eea736a38eff9ac183326d6c7e4e239b (patch)
tree54927ab8209a73403320aac67b6172508caed7d6 /packaging
parent5c579482eb2dd33c7fea80ea1ab412977606458a (diff)
parent6fa5e0814662d691be1a29bf88332348ec7c50c9 (diff)
downloadmariadb-git-663068c6eea736a38eff9ac183326d6c7e4e239b.tar.gz
Merge remote-tracking branch 'mysql/5.5' into 5.5mariadb-5.5.55
Diffstat (limited to 'packaging')
-rw-r--r--packaging/rpm-oel/mysql.init34
1 files changed, 20 insertions, 14 deletions
diff --git a/packaging/rpm-oel/mysql.init b/packaging/rpm-oel/mysql.init
index 79c8a8daa7d..56dee65888f 100644
--- a/packaging/rpm-oel/mysql.init
+++ b/packaging/rpm-oel/mysql.init
@@ -23,31 +23,37 @@ 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
-# extract value of a MySQL option from config files
-# Usage: get_mysql_option SECTION VARNAME DEFAULT
-# result is returned in $result
+# Extract value of a MySQL option from config files
+# Usage: get_mysql_option OPTION DEFAULT SECTION1 SECTION2 SECTIONN
+# Result is returned in $result
# We use my_print_defaults which prints all options from multiple files,
# with the more specific ones later; hence take the last match.
-get_mysql_option(){
- result=`/usr/bin/my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1`
- if [ -z "$result" ]; then
- # not found, use default
- result="$3"
- fi
+get_mysql_option () {
+ option=$1
+ default=$2
+ shift 2
+ result=$(/usr/bin/my_print_defaults "$@" | sed -n "s/^--${option}=//p" | tail -n 1)
+ if [ -z "$result" ]; then
+ # not found, use default
+ result="${default}"
+ fi
}
-get_mysql_option mysqld datadir "/var/lib/mysql"
+get_mysql_option datadir "/var/lib/mysql" mysqld
datadir="$result"
-get_mysql_option mysqld socket "$datadir/mysql.sock"
+get_mysql_option socket "$datadir/mysql.sock" mysqld
socketfile="$result"
-get_mysql_option mysqld_safe log-error "/var/log/mysqld.log"
+get_mysql_option log-error "/var/log/mysqld.log" mysqld mysqld_safe
errlogfile="$result"
-get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid"
+get_mysql_option pid-file "/var/run/mysqld/mysqld.pid" mysqld mysqld_safe
mypidfile="$result"
case $socketfile in
@@ -100,7 +106,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 2>&1 &
safe_pid=$!