[packages/mysql] logrotate per major ver
arekm
arekm at pld-linux.org
Sun Nov 19 04:27:43 CET 2023
commit 468359f5615b0ad1cf6d82fec5eea02a10b33928
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sun Nov 19 02:42:49 2023 +0100
logrotate per major ver
mysql.logrotate | 12 ++++++------
mysql.spec | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/mysql.spec b/mysql.spec
index 06b45b7..b01f597 100644
--- a/mysql.spec
+++ b/mysql.spec
@@ -566,7 +566,7 @@ install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,%{name},skel}
sed -e 's#{MYSQL_MAJOR}#%{majorver}#g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
-cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+sed -e 's#{MYSQL_MAJOR}#%{majorver}#g' %{SOURCE3} > $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
# This is template for configuration file which is created after 'service mysql init'
sed -e 's#{MYSQL_MAJOR}#%{majorver}#g' %{SOURCE4} > mysqld.conf
sed -e 's#{MYSQL_MAJOR}#%{majorver}#g' %{SOURCE5} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/clusters.conf
diff --git a/mysql.logrotate b/mysql.logrotate
index 4bb78ce..26a4e69 100644
--- a/mysql.logrotate
+++ b/mysql.logrotate
@@ -11,12 +11,12 @@
#
# You must do this for every active cluster defined in /etc/mysql/clusters.conf
-/var/log/mysql/query.log
-/var/log/mysql/mysqld.log
-/var/log/mysql/slow.log
-/var/log/mysql/update*
+/var/log/mysql{MYSQL_MAJOR}/query.log
+/var/log/mysql{MYSQL_MAJOR}/mysqld.log
+/var/log/mysql{MYSQL_MAJOR}/slow.log
+/var/log/mysql{MYSQL_MAJOR}/update*
{
- olddir /var/log/archive/mysql
+ olddir /var/log/archive/mysql{MYSQL_MAJOR}
notifempty
missingok
create 640 mysql mysql
@@ -29,6 +29,6 @@
daily
postrotate
- /sbin/service mysql flush-logs
+ /sbin/service mysql{MYSQL_MAJOR} flush-logs
endscript
}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/mysql.git/commitdiff/468359f5615b0ad1cf6d82fec5eea02a10b33928
More information about the pld-cvs-commit
mailing list