mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user