CentOS 5: add logrotate
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 8 Sep 2010 14:04:07 +0000 (16:04 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 8 Sep 2010 14:04:46 +0000 (16:04 +0200)
pazpar2.spec.in
src/Makefile.am
src/pazpar2.rpm.logrotate [new file with mode: 0644]

index fa11129..b7f35a3 100644 (file)
@@ -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*
index 9004ce9..5b59b48 100644 (file)
@@ -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 (file)
index 0000000..b2bd6fb
--- /dev/null
@@ -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
+}