From: Adam Dickmeiss Date: Wed, 8 Sep 2010 14:04:07 +0000 (+0200) Subject: CentOS 5: add logrotate X-Git-Tag: v1.5.0~11^2~1 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=c0a76422c4b7674180b723d019ab08dbe3066639;p=pazpar2-moved-to-github.git CentOS 5: add logrotate --- diff --git a/pazpar2.spec.in b/pazpar2.spec.in index fa11129..b7f35a3 100644 --- a/pazpar2.spec.in +++ b/pazpar2.spec.in @@ -85,6 +85,9 @@ cp etc/*.xsl ${RPM_BUILD_ROOT}/etc/pazpar2/ mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d install -m755 src/pazpar2.rpm.init ${RPM_BUILD_ROOT}/etc/rc.d/init.d/pazpar2 echo "Alias /pazpar2 /usr/share/pazpar2" >${RPM_BUILD_ROOT}/etc/pazpar2/ap2pazpar2-js.cfg +mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d +install -m644 src/pazpar2.rpm.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/pazpar2 + %clean rm -fr ${RPM_BUILD_ROOT} @@ -101,6 +104,7 @@ rm -fr ${RPM_BUILD_ROOT} %config %{_sysconfdir}/pazpar2/settings/*.xml %config %{_sysconfdir}/pazpar2/services-available/*.xml %config %{_sysconfdir}/rc.d/init.d/pazpar2 +%config(noreplace) /etc/logrotate.d/pazpar2 %{_mandir}/man5/pazpar2* %{_mandir}/man7/pazpar2* %{_mandir}/man8/pazpar2* diff --git a/src/Makefile.am b/src/Makefile.am index 9004ce9..5b59b48 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ sbin_PROGRAMS = pazpar2 -EXTRA_DIST = pazpar2.rpm.init +EXTRA_DIST = pazpar2.rpm.init pazpar2.rpm.logrotate check_PROGRAMS = \ test_sel_thread \ diff --git a/src/pazpar2.rpm.logrotate b/src/pazpar2.rpm.logrotate new file mode 100644 index 0000000..b2bd6fb --- /dev/null +++ b/src/pazpar2.rpm.logrotate @@ -0,0 +1,13 @@ +/var/log/pazpar2.log { + weekly + missingok + rotate 4 + compress + delaycompress + notifempty + postrotate + if [ -f /var/run/pazpar2.pid ]; then + /sbin/service pazpar2 restart > /dev/null + fi + endscript +}