Skip to content

Commit

Permalink
BUG#21879694 - /VAR/LOG/MYSQLD.LOG HAS INCORRECT PERMISSIONS AFTER IN…
Browse files Browse the repository at this point in the history
…STALLING 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.
  • Loading branch information
bkandasa committed May 18, 2016
1 parent 90b9c95 commit 8281068
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packaging/rpm-oel/mysql.spec.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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
Expand Down Expand Up @@ -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 || :
Expand Down
3 changes: 2 additions & 1 deletion packaging/rpm-sles/mysql.spec.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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
Expand Down Expand Up @@ -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 || :
Expand Down

0 comments on commit 8281068

Please sign in to comment.