- add the possibility to switch of cron job (#493063)

This commit is contained in:
Ivana Varekova 2009-06-25 13:39:39 +00:00
parent 77fd01c704
commit 9eef10cfe7
2 changed files with 33 additions and 2 deletions

View File

@ -0,0 +1,14 @@
diff -up logwatch-7.3.6/conf/logwatch.conf.pom logwatch-7.3.6/conf/logwatch.conf
--- logwatch-7.3.6/conf/logwatch.conf.pom 2009-06-25 10:47:22.000000000 +0200
+++ logwatch-7.3.6/conf/logwatch.conf 2009-06-25 10:47:00.000000000 +0200
@@ -121,4 +121,10 @@ mailer = "sendmail -t"
#
#HostLimit = Yes
+# By default the cron daemon generates daily logwatch report
+# if you want to switch it off uncomment DailyReport tag.
+# The implicit value is Yes
+#
+# DailyReport = No
+
# vi: shiftwidth=3 tabstop=3 et

View File

@ -1,7 +1,7 @@
Summary: A log file analysis program
Name: logwatch
Version: 7.3.6
Release: 43%{?dist}
Release: 44%{?dist}
License: MIT
Group: Applications/System
URL: http://www.logwatch.org/
@ -52,6 +52,7 @@ Patch52: logwatch-7.3.6-smartd.patch
Patch53: logwatch-7.3.6-sshd2.patch
Patch54: logwatch-7.3.6-exim2.patch
Patch55: logwatch-7.3.6-removeservice.patch
Patch56: logwatch-7.3.6-cron_conf.patch
Requires: textutils sh-utils grep mailx
Requires: perl(Date::Manip)
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -111,6 +112,7 @@ of the package on many systems.
%patch53 -p1
%patch54 -p1
%patch55 -p1
%patch56 -p1
rm -f scripts/services/*.orig
%build
@ -166,8 +168,20 @@ chmod 644 %{buildroot}%{_datadir}/logwatch/scripts/services/zz-fortune
chmod 644 %{buildroot}%{_datadir}/logwatch/scripts/services/courier
chmod 644 %{buildroot}%{_datadir}/logwatch/scripts/services/dpkg
# install cron script
install -m 0755 -d %{buildroot}%{_sysconfdir}/cron.daily
ln -s ../../%{_datadir}/logwatch/scripts/logwatch.pl %{buildroot}/%{_sysconfdir}/cron.daily/0logwatch
cat > %{buildroot}/%{_sysconfdir}/cron.daily/0logwatch <<EOF
#!/bin/bash
DailyReport=`grep -e "^[[:space:]]*DailyReport[[:space:]]*=[[:space:]]*" /usr/share/logwatch/default.conf/logwatch.conf | head -n1 | sed -e "s|^\s*DailyReport\s*=\s*||"`
if [ $DailyReport != "No" ] && [ $DailyReport != "no" ]
then
logwatch
fi
EOF
chmod 755 %{buildroot}/%{_sysconfdir}/cron.daily/0logwatch
install -m 0755 -d %{buildroot}%{_sbindir}
ln -s ../../%{_datadir}/logwatch/scripts/logwatch.pl %{buildroot}/%{_sbindir}/logwatch
@ -222,6 +236,9 @@ rm -rf %{buildroot}
%doc License project/CHANGES
%changelog
* Thu Jun 25 2009 Ivana Varekova <varekova@redhat.com> 7.3.6-44
- add the possibility to switch of cron job (#493063)
* Mon Jun 15 2009 Ivana Varekova <varekova@redhat.com> 7.3.6-43
- fix removeservice script - to decrease the number of
perl instances running simultaneously