summaryrefslogtreecommitdiff
path: root/scripts/mysqld_safe.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mysqld_safe.sh')
-rw-r--r--scripts/mysqld_safe.sh26
1 files changed, 17 insertions, 9 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index a537bf27aad..c12d351d206 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -172,10 +172,14 @@ parse_arguments() {
case "$arg" in
# these get passed explicitly to mysqld
--basedir=*) MY_BASEDIR_VERSION="$val" ;;
- --datadir=*) DATADIR="$val" ;;
+ --datadir=*|--data=*) DATADIR="$val" ;;
--pid-file=*) pid_file="$val" ;;
--plugin-dir=*) PLUGIN_DIR="$val" ;;
--user=*) user="$val"; SET_USER=1 ;;
+ --log-basename=*|--hostname=*|--loose-log-basename=*)
+ pid_file="$val.pid";
+ err_log="$val.err";
+ ;;
# these might have been set in a [mysqld_safe] section of my.cnf
# they are added to mysqld command line to override settings from my.cnf
@@ -484,7 +488,7 @@ append_arg_to_args () {
args=
SET_USER=2
-parse_arguments `$print_defaults $defaults --loose-verbose mysqld server`
+parse_arguments `$print_defaults $defaults --loose-verbose mysqld mariadb server client-server`
if test $SET_USER -eq 2
then
SET_USER=0
@@ -582,7 +586,11 @@ safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
if [ ! -d $mysql_unix_port_dir ]
then
- mkdir $mysql_unix_port_dir
+ if ! `mkdir -p $mysql_unix_port_dir`
+ then
+ echo "Fatal error Can't create database directory '$mysql_unix_port'"
+ exit 1
+ fi
chown $user $mysql_unix_port_dir
chmod 755 $mysql_unix_port_dir
fi
@@ -605,14 +613,14 @@ fi
if test -z "$pid_file"
then
- pid_file="$DATADIR/`@HOSTNAME@`.pid"
-else
- case "$pid_file" in
- /* ) ;;
- * ) pid_file="$DATADIR/$pid_file" ;;
- esac
+ pid_file="`@HOSTNAME@`.pid"
fi
+# MariaDB wants pid file without datadir
append_arg_to_args "--pid-file=$pid_file"
+case "$pid_file" in
+ /* ) ;;
+ * ) pid_file="$DATADIR/$pid_file" ;;
+esac
if test -n "$mysql_unix_port"
then