diff options
author | Jonathan Perkin <jperkin@sun.com> | 2009-11-23 13:34:39 +0000 |
---|---|---|
committer | Jonathan Perkin <jperkin@sun.com> | 2009-11-23 13:34:39 +0000 |
commit | 2ca14303dba220237bd73fc141b6020ed869573c (patch) | |
tree | bec543f896f88008997a19c83658e6cac62af983 /scripts | |
parent | a25a3fb13437eeb6b1a6501da58c44bc41931129 (diff) | |
download | mariadb-git-2ca14303dba220237bd73fc141b6020ed869573c.tar.gz |
bug#36462: mysql_install_db fails when run as user root and
root-directory not writable
Rather than use the -w test, attempt the chown and bail out if
it fails.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysql_install_db.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 7e9b8a69677..b4cfc054b35 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -358,9 +358,15 @@ do mkdir -p $dir chmod 700 $dir fi - if test -w / -a ! -z "$user" + if test -n "$user" then chown $user $dir + if test $? -ne 0 + then + echo "Cannot change ownership of the database directories to the '$user'" + echo "user. Check that you have the necessary permissions and try again." + exit 1 + fi fi done |