[icinga-checkins] icinga.org: icinga2/next: Fix logrotate should rotate log files as icinga user

git at icinga.org git at icinga.org
Fri Jun 13 09:49:38 CEST 2014


Module: icinga2
Branch: next
Commit: 74751a4e22526fe8cfdc474c86b4d25152f98a84
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=74751a4e22526fe8cfdc474c86b4d25152f98a84

Author: Tim Hardeck <thardeck at suse.de>
Date:   Fri Jun 13 09:47:26 2014 +0200

Fix logrotate should rotate log files as icinga user

fixes #6477

---

 etc/logrotate.d/icinga2.cmake |    2 ++
 icinga2.spec                  |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/etc/logrotate.d/icinga2.cmake b/etc/logrotate.d/icinga2.cmake
index 5aa1ff9..543ae5c 100644
--- a/etc/logrotate.d/icinga2.cmake
+++ b/etc/logrotate.d/icinga2.cmake
@@ -1,6 +1,7 @@
 @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/icinga2.log @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/debug.log {
        	daily
 	rotate 7
+	su @ICINGA2_USER@ @ICINGA2_GROUP@
 	compress
 	delaycompress
        	missingok
@@ -16,6 +17,7 @@
 
 @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/error.log {
 	daily
+	su @ICINGA2_USER@ @ICINGA2_GROUP@
 	rotate 90
 	compress
 	delaycompress
diff --git a/icinga2.spec b/icinga2.spec
index 675cfc8..4989d79 100644
--- a/icinga2.spec
+++ b/icinga2.spec
@@ -460,7 +460,7 @@ exit 0
 %files common
 %defattr(-,root,root,-)
 %doc COPYING COPYING.Exceptions README NEWS AUTHORS ChangeLog tools/syntax
-%attr(755,-,-) %{_sysconfdir}/logrotate.d/%{name}
+%config(noreplace) %attr(755,-,-) %{_sysconfdir}/logrotate.d/%{name}
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/perfdata
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/tmp



More information about the icinga-checkins mailing list