From 74751a4e22526fe8cfdc474c86b4d25152f98a84 Mon Sep 17 00:00:00 2001 From: Tim Hardeck Date: Fri, 13 Jun 2014 09:47:26 +0200 Subject: [PATCH] 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 5aa1ff9da..543ae5ce2 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 675cfc8e9..4989d79d9 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