Bug#25159791 BASEDIR: COMMAND NOT FOUND ERROR WHILE STARTING SERVER WITH INIT SCRIPTS

parent 251e82c2
......@@ -22,7 +22,7 @@ install_db () {
datadir=$(get_option mysqld datadir "/var/lib/mysql")
# Restore log, dir, perms and SELinux contexts
if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(basedir "$datadir")" = "x/var/lib" ]; then
if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
fi
log=/var/log/mysqld.log
......
......@@ -76,10 +76,10 @@ start(){
[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
if [ ! -d "$datadir/mysql" ] ; then
# First, make sure $datadir is there with correct permissions
if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(basedir "$datadir")" = "x/var/lib" ]; then
if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
install -d -m0755 -omysql -gmysql "$datadir" || exit 1
fi
if [ ! -h "$datadir" -a "x$(basedir "$datadir")" = "x/var/lib" ]; then
if [ ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
chown mysql:mysql "$datadir"
chmod 0755 "$datadir"
fi
......@@ -99,7 +99,7 @@ start(){
return $ret
fi
fi
if [ ! -h "$datadir" -a "x$(basedir "$datadir")" = "x/var/lib" ]; then
if [ ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
chown mysql:mysql "$datadir"
chmod 0755 "$datadir"
fi
......
......@@ -57,7 +57,7 @@ install_db () {
logfile=$(get_option mysqld_safe log-error "/var/log/mysql/mysqld.log")
# Restore log, dir, perms and SELinux contexts
if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(basedir "$datadir")" = "x/var/lib" ]; then
if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
install -d -m 0755 -omysql -gmysql "$datadir" || return 1
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment