From 8281068f72385fb559906ca14f29bd3871b8830d Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Wed, 18 May 2016 17:23:16 +0530 Subject: 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. --- packaging/rpm-oel/mysql.spec.in | 3 ++- packaging/rpm-sles/mysql.spec.in | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packaging/rpm-oel/mysql.spec.in b/packaging/rpm-oel/mysql.spec.in index 8a020b05ae6..8f92f5b84f3 100644 --- a/packaging/rpm-oel/mysql.spec.in +++ b/packaging/rpm-oel/mysql.spec.in @@ -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 @@ -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 || : diff --git a/packaging/rpm-sles/mysql.spec.in b/packaging/rpm-sles/mysql.spec.in index 91c708a583d..47c40b00e23 100644 --- a/packaging/rpm-sles/mysql.spec.in +++ b/packaging/rpm-sles/mysql.spec.in @@ -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 @@ -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 || : -- cgit v1.2.1