• unknown's avatar
    Fix for BUG#4038 "rpm postinstall script leaves files as owned by root": · 7a00d199
    unknown authored
    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.
    7a00d199
mysql.spec.sh 24.9 KB