summaryrefslogtreecommitdiff
path: root/support-files
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-06-09 17:07:11 +0200
committerunknown <guilhem@mysql.com>2004-06-09 17:07:11 +0200
commit7a00d199a4bc83f9e3d940003c6c0f6c117d9650 (patch)
treeadbbf8895f733fb48b69d48e981bfe18369b0bad /support-files
parent57ae9ed0ad2ca690cafdf34be4bc5fe0b7fbd8ff (diff)
downloadmariadb-git-7a00d199a4bc83f9e3d940003c6c0f6c117d9650.tar.gz
Fix for BUG#4038 "rpm postinstall script leaves files as owned by root":
the rpm postinstall script must call mysql_install_db with --user=mysql, and mysql_install_db must then pass this to mysqld. Otherwise, mysqld runs as root, and if you have --log-bin=somewhere_out_of_var_lib_mysql it creates binlog files owned by root in this dir, and this dir is not fixed by the 'chmod mysql', so files remain owned by root, and later mysqld (running as 'mysql') can't read them. I'm hardcoding 'mysql' in the postinstall script, but it's already hardcoded there in many places (see the useradd and chown) so it's ok. scripts/mysql_install_db.sh: Pass --user to mysqld support-files/mysql.spec.sh: in postinstall, call mysql_install_db with --user=mysql, so that mysqld (which installs the grant tables) is started with --user=mysql.
Diffstat (limited to 'support-files')
-rw-r--r--support-files/mysql.spec.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 714992e0826..5ddc19580f3 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -395,7 +395,7 @@ useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" mysql 2> /dev/nul
chown -R mysql $mysql_datadir
# Initiate databases
-mysql_install_db -IN-RPM
+mysql_install_db -IN-RPM --user=mysql
# Change permissions again to fix any new files.
chown -R mysql $mysql_datadir