BUG#21879694 - /VAR/LOG/MYSQLD.LOG HAS INCORRECT PERMISSIONS AFTER INSTALLING SERVER FROM REPO

Description:
This issue doesn't effect any default installation of repo rpms if user uses
init scripts that are shipped as part of package but will have trouble if
user tries to createdb or start server manually.

After installing mysql-server from repository(yum,zypper) /var/log/mysqld.log
is created with logged in user and group permissions instead of with mysql
user and group permissions,due to which while creating database or starting
server, it is failing

Fix:

Updated the user and group permissions of the /var/log/mysqld.log and
/var/log/mysql/mysqld.log (for sles) files to mysql.
parent 90b9c957
# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -629,6 +629,7 @@ rm -r $(readlink var) var
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
/bin/chmod 0755 "$datadir"
/bin/touch /var/log/mysqld.log
/bin/chown mysql:mysql /var/log/mysqld.log >/dev/null 2>&1 || :
%if 0%{?systemd}
%systemd_post mysqld.service
/sbin/service mysqld enable >/dev/null 2>&1 || :
......
# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -492,6 +492,7 @@ rm -r $(readlink var) var
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
/bin/chmod 0755 "$datadir"
/bin/touch /var/log/mysql/mysqld.log
/bin/chown mysql:mysql /var/log/mysql/mysqld.log >/dev/null 2>&1 || :
%if 0%{?systemd}
%systemd_post mysqld.service
/sbin/service mysqld enable >/dev/null 2>&1 || :
......
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