[meta-oe] mariadb: redefine log-error item

Submitted by mingli.yu@windriver.com on July 30, 2021, 12:11 p.m. | Patch ID: 180010

Details

Message ID 20210730121128.31993-1-mingli.yu@windriver.com
State Accepted
Commit 1a4144d954692ad68121d16adae09dc990e8ab1f
Headers show

Commit Message

mingli.yu@windriver.com July 30, 2021, 12:11 p.m.
From: Mingli Yu <mingli.yu@windriver.com>

The log-error item which defined in my.cnf is "/var/log/mysqld.err"
previouly and it's not consistent with which created in install_db
service file which will call mysql-systemd-start to create the file
"/var/log/mysqld.log".

And it fails when boot with sysvinit as below:
 $ service mysqld start
 Starting MariaDB.210727 04:05:03 mysqld_safe Logging to '/var/log/mysqld.err'.
 210727 04:05:03 mysqld_safe Starting mariadbd daemon with databases from /var/lib/mysql
 /usr/bin/mysqld_safe_helper: Can't create/write to file '/var/log/mysqld.err' (Errcode: 13 "Permission denied")

So make the log-error item consistent to fix the above failure
and also remove the related workaround when boot with systemd.

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 meta-oe/recipes-dbs/mysql/mariadb.inc    | 5 -----
 meta-oe/recipes-dbs/mysql/mariadb/my.cnf | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc
index 5787ae4bd..7cf08f471 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb.inc
+++ b/meta-oe/recipes-dbs/mysql/mariadb.inc
@@ -168,11 +168,6 @@  do_install() {
     sed -i -e 's,@BINDIR@,${bindir},g' -e 's,@PREFIX@,${prefix},g' ${D}${systemd_unitdir}/system/mysqld.service \
                                                                    ${D}${systemd_unitdir}/system/install_db.service
 
-    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/tmpfiles.d
-        echo "f /var/log/mysqld.err 0640 mysql mysql -" \
-            > ${D}${sysconfdir}/tmpfiles.d/99-mysqld.conf
-    fi
     install -d ${D}${bindir}
     install -m 755 ${WORKDIR}/mysql-systemd-start ${D}${bindir}
     install -d ${D}${datadir}/doc/${PN}
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/my.cnf b/meta-oe/recipes-dbs/mysql/mariadb/my.cnf
index dc4c172e5..75db46a55 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb/my.cnf
+++ b/meta-oe/recipes-dbs/mysql/mariadb/my.cnf
@@ -10,7 +10,7 @@  user 						= mysql
 port 						= 3306
 socket 						= /var/lib/mysql/mysql.sock
 pid-file 					= /var/lib/mysql/mysqld.pid
-log-error 					= /var/log/mysqld.err
+log-error 					= /var/log/mysqld.log
 basedir 					= /usr
 datadir 					= /var/lib/mysql
 skip-external-locking