Fix the logrotate file

The sources contains two versions of the logrotate file:
* mysql-8.0.30/support-files/mysql-log-rotate.in
* mysql-8.0.30/packaging/rpm-common/mysql.logrotate.in

Until now, the first one was used. However logfile location
specified in that logrotate configuration file was wrong.
( /var/lib/mysql/mysqld.log )

From now on, we will use the second one, which is meant to be
used in RPM packages, and which respects their FSH layout.
( /var/log/mysql/mysqld.log )

--

As a side-effect, the whole configuration is now commented out.
So users now need to touch the file before they can start using it.

However once the configuration is un-commented,
it will work out-of-the-box (unlike until now).

--

Resolves: #2073434
This commit is contained in:
Michal Schorm 2022-08-11 15:31:49 +02:00
parent bd72d73442
commit 5692c7a1f4

View File

@ -543,10 +543,12 @@ install -D -p -m 0644 %{_vpath_builddir}/scripts/server.cnf %{buildroot}%{_sysco
rm %{buildroot}%{_libdir}/mysql/*.a
rm %{buildroot}%{_mandir}/man1/comp_err.1*
# put logrotate script where it needs to be
# Put logrotate script where it needs to be
mkdir -p %{buildroot}%{logrotateddir}
mv %{buildroot}%{_datadir}/%{pkg_name}/mysql-log-rotate %{buildroot}%{logrotateddir}/%{daemon_name}
chmod 644 %{buildroot}%{logrotateddir}/%{daemon_name}
# Remove the wrong file
rm %{buildroot}%{_datadir}/%{pkg_name}/mysql-log-rotate
# Install the correct one (meant for FSH layout in RPM packages)
install -D -m 0644 %{_vpath_builddir}/packaging/rpm-common/mysql.logrotate %{buildroot}%{logrotateddir}/%{daemon_name}
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf