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

parent 251e82c2
...@@ -22,7 +22,7 @@ install_db () { ...@@ -22,7 +22,7 @@ install_db () {
datadir=$(get_option mysqld datadir "/var/lib/mysql") datadir=$(get_option mysqld datadir "/var/lib/mysql")
# Restore log, dir, perms and SELinux contexts # 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 install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
fi fi
log=/var/log/mysqld.log log=/var/log/mysqld.log
......
...@@ -76,10 +76,10 @@ start(){ ...@@ -76,10 +76,10 @@ start(){
[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile" [ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
if [ ! -d "$datadir/mysql" ] ; then if [ ! -d "$datadir/mysql" ] ; then
# First, make sure $datadir is there with correct permissions # 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 install -d -m0755 -omysql -gmysql "$datadir" || exit 1
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" chown mysql:mysql "$datadir"
chmod 0755 "$datadir" chmod 0755 "$datadir"
fi fi
...@@ -99,7 +99,7 @@ start(){ ...@@ -99,7 +99,7 @@ start(){
return $ret return $ret
fi fi
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" chown mysql:mysql "$datadir"
chmod 0755 "$datadir" chmod 0755 "$datadir"
fi fi
......
...@@ -57,7 +57,7 @@ install_db () { ...@@ -57,7 +57,7 @@ install_db () {
logfile=$(get_option mysqld_safe log-error "/var/log/mysql/mysqld.log") logfile=$(get_option mysqld_safe log-error "/var/log/mysql/mysqld.log")
# Restore log, dir, perms and SELinux contexts # 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 install -d -m 0755 -omysql -gmysql "$datadir" || return 1
fi 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