[zabbix20/el6] Handle logrotate directions properly

Volker Fröhlich volter at fedoraproject.org
Tue Jun 3 20:13:48 UTC 2014


commit 5bdbfe2a32c01031ddbfe141141f6f1096fb9426
Author: Volker Fröhlich <volker27 at gmx.at>
Date:   Tue Jun 3 22:07:39 2014 +0200

    Handle logrotate directions properly

 zabbix-logrotate.in |    4 ++--
 zabbix20.spec       |   21 ++++++++++++---------
 2 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/zabbix-logrotate.in b/zabbix-logrotate.in
index c2f9045..84f86ae 100644
--- a/zabbix-logrotate.in
+++ b/zabbix-logrotate.in
@@ -3,6 +3,6 @@
 	monthly
 	notifempty
 	compress
-	create 0664 zabbix zabbix
-	su zabbix zabbix
+	create 0664 USER zabbix
+	su USER zabbix
 }
diff --git a/zabbix20.spec b/zabbix20.spec
index 2718d4c..d411d6c 100644
--- a/zabbix20.spec
+++ b/zabbix20.spec
@@ -19,7 +19,7 @@
 
 Name:           zabbix20
 Version:        2.0.11
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Open-source monitoring solution for your IT infrastructure
 
 Group:          Applications/Internet
@@ -272,11 +272,6 @@ Zabbix web frontend for PostgreSQL
 %patch3 -p1
 %endif
 
-# Logrotate's su option is currently only available in Fedora
-%if 0%{?rhel}
-sed -i '/su zabbix zabbix/d' %{SOURCE5}
-%endif
-
 # Remove flash applet
 # https://support.zabbix.com/browse/ZBX-4794
 %patch2 -p1
@@ -433,13 +428,18 @@ mv $RPM_BUILD_ROOT%{_datadir}/%{srcname}/conf/maintenance.inc.php $RPM_BUILD_ROO
 install -m 0644 -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{srcname}.conf
 
 # Install log rotation
-sed -e 's|COMPONENT|agentd|g' %{SOURCE5} > \
+sed -e 's|COMPONENT|agentd|g; s|USER|zabbix|g' %{SOURCE5} > \
      $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-agent
-sed -e 's|COMPONENT|server|g' %{SOURCE5} > \
+sed -e 's|COMPONENT|server|g; s|USER|zabbixsrv|g' %{SOURCE5} > \
      $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-server
-sed -e 's|COMPONENT|proxy|g' %{SOURCE5} > \
+sed -e 's|COMPONENT|proxy|g; s|USER|zabbixsrv|g' %{SOURCE5} > \
      $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-proxy
 
+# Logrotate's su option is only available in Fedora and EL 7
+%if 0%{?rhel}
+sed -i '/su USER zabbix/d' $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-*
+%endif
+
 %if 0%{?fedora}
 # Install different systemd units because of the requirements for DBMS daemons
 install -m 0644 -p %{SOURCE10} $RPM_BUILD_ROOT%{_unitdir}/zabbix-agent.service
@@ -835,6 +835,9 @@ fi
 %files web-pgsql
 
 %changelog
+* Tue Jun  3 2014 Volker Fröhlich <volker27 at gmx.at> - 2.0.11-2
+- Handle su directive in logrotate configuration properly (BZ1074318) 
+
 * Wed Feb 12 2014 Volker Fröhlich <volker27 at gmx.at> - 2.0.11-1
 - New upstream release
 - Truncate changelog


More information about the scm-commits mailing list