]> git.pld-linux.org Git - packages/mysql.git/commitdiff
logrotate per major ver
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 19 Nov 2023 01:42:49 +0000 (02:42 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 19 Nov 2023 01:42:49 +0000 (02:42 +0100)
mysql.logrotate
mysql.spec

index 4bb78ceb9acd84287db5a16baef4e66400b9d1a3..26a4e694eb257789b81ea8bac3c49d488ae55e8e 100644 (file)
 #
 # 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
 }
index 06b45b77b34673e929820650996c4cdf179f7822..b01f597041934986f2f15369e34f2c500022d36b 100644 (file)
@@ -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
This page took 0.145324 seconds and 4 git commands to generate.