From 834d920e34172d525dfc29977f5c40ea8bbb0025 Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Mon, 12 Sep 2022 16:46:01 +0200 Subject: [PATCH] Fix the logrotate file [2] In one of the previous commits, I've started to pack a different logrotate file as it contains the correct path to the logfile of the mysql server. It has been found, that I've overlooked that the filepath to the mysql server was still set wrongly. It was set to a: '/var/log/mysqld.log' Instead of expected: '/var/log/mysql/mysql.log' This path is added to the mysql logrotate configuration file via CMAKE variable substitution. However since we haven't specify the variable value, a default value has been used instead. The fix to this issue was simple - specify the variable value as the CMAKE command argument. -- At the same time, we were using a custom (downstream) variable meant to hold the same information. We used this variable for generating the correct filepath to the mysql server logfile in the mysql server configuration file. Instead of using two different CMAKE variables with the same meaning, I've changed it so we get rid of the downstream specified variable and use the upstream specified variable instead. -- The positive effect is the de-duplication of code and assurance that when we set the value, it is used everywhere - both in the upstream code and in the downstream patches. The tiny negative effect is that at this moment, the names of the variables differ to the we use in 'mariadb' package. --- community-mysql.spec | 2 +- server.cnf.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/community-mysql.spec b/community-mysql.spec index be4a7d1..2891d92 100644 --- a/community-mysql.spec +++ b/community-mysql.spec @@ -442,7 +442,7 @@ cp %{SOURCE2} %{SOURCE3} %{SOURCE10} %{SOURCE11} %{SOURCE12} \ -DINSTALL_LAYOUT=RPM \ -DDAEMON_NAME="%{daemon_name}" \ -DDAEMON_NO_PREFIX="%{daemon_no_prefix}" \ - -DLOG_LOCATION="%{logfile}" \ + -DLOGFILE_RPM="%{logfile}" \ -DPID_FILE_DIR="%{pidfiledir}" \ -DNICE_PROJECT_NAME="MySQL" \ -DCMAKE_INSTALL_PREFIX="%{_prefix}" \ diff --git a/server.cnf.in b/server.cnf.in index ba3d479..727ca52 100644 --- a/server.cnf.in +++ b/server.cnf.in @@ -13,6 +13,6 @@ [mysqld] datadir=@MYSQL_DATADIR@ socket=@MYSQL_UNIX_ADDR@ -log-error=@LOG_LOCATION@ +log-error=@LOGFILE_RPM@ pid-file=@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid