[webalizer] - Don't run cronjob unless configured in /etc/sysconfig/webalizer (merge review #298203)

Ruben Kerkhof ruben at fedoraproject.org
Sun Oct 17 18:27:49 UTC 2010


commit 3cd02f6881c0f3f3613e534075bb6f8ee1a82df6
Author: Ruben <ruben at rubenkerkhof.com>
Date:   Sun Oct 17 20:27:43 2010 +0200

    - Don't run cronjob unless configured in /etc/sysconfig/webalizer (merge review #298203)

 webalizer.cron      |   13 +++++++++----
 webalizer.spec      |   10 +++++++++-
 webalizer.sysconfig |    5 +++++
 3 files changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/webalizer.cron b/webalizer.cron
index 1cf7e3b..063fe51 100644
--- a/webalizer.cron
+++ b/webalizer.cron
@@ -1,6 +1,11 @@
-#! /bin/bash
+#!/bin/bash
 # update access statistics for the web site
 
-if [ -s /var/log/httpd/access_log ]; then
-   exec /usr/bin/webalizer -Q
-fi
+NAME=webalizer
+
+[ -f /etc/sysconfig/$NAME ] || exit 0
+source /etc/sysconfig/$NAME
+
+[ "z$WEBALIZER_CRON" != "zyes" ] && exit 0
+
+exec /usr/bin/webalizer -Q
diff --git a/webalizer.spec b/webalizer.spec
index e2b11c2..2e4dfd5 100644
--- a/webalizer.spec
+++ b/webalizer.spec
@@ -7,13 +7,14 @@ Name: webalizer
 Summary: A flexible Web server log file analysis program
 Group: Applications/Internet
 Version: 2.21_02
-Release: 3
+Release: 4
 URL: http://www.mrunix.net/webalizer/
 License: GPLv2+
 Source0: ftp://ftp.mrunix.net/pub/webalizer/%{name}-%{ver}-%{patchlevel}-src.tar.bz2
 Source1: webalizer.conf
 Source2: webalizer.cron
 Source3: webalizer-httpd.conf
+Source4: webalizer.sysconfig
 Patch4: webalizer-2.21-02-underrun.patch
 Patch6: webalizer-2.01_10-confuser.patch
 Patch9: webalizer-2.01-10-groupvisit.patch
@@ -59,6 +60,9 @@ install -p -m 755 $RPM_SOURCE_DIR/webalizer.cron \
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
 install -p -m 644 $RPM_SOURCE_DIR/webalizer-httpd.conf \
         $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/webalizer.conf
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
+install -p -m 644 $RPM_SOURCE_DIR/webalizer.sysconfig \
+        $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/webalizer
 
 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/webalizer.conf.sample
 
@@ -77,11 +81,15 @@ rm -rf $RPM_BUILD_ROOT
 %config(noreplace) %{_sysconfdir}/webalizer.conf
 %{_sysconfdir}/cron.daily/00webalizer
 %config(noreplace) %{_sysconfdir}/httpd/conf.d/webalizer.conf
+%config(noreplace) %{_sysconfdir}/sysconfig/webalizer
 %attr(-, webalizer, root) %dir %{_localstatedir}/www/usage
 %attr(-, webalizer, root) %dir %{_localstatedir}/lib/webalizer
 %attr(-, webalizer, root) %{_localstatedir}/www/usage/*.png
 
 %changelog
+* Sun Oct 17 2010 Ruben Kerkhof <ruben at rubenkerkhof.com> 2.21_02-4
+- Don't run cronjob unless configured in /etc/sysconfig/webalizer (merge review #298203)
+
 * Mon Jul 27 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.21_02-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 
diff --git a/webalizer.sysconfig b/webalizer.sysconfig
new file mode 100644
index 0000000..f436132
--- /dev/null
+++ b/webalizer.sysconfig
@@ -0,0 +1,5 @@
+# uncomment if you want webalizer to be run each day by
+# /etc/cron.daily/00webalizer
+
+#WEBALIZER_CRON=yes
+


More information about the scm-commits mailing list