From 0ce995fb69af39c55a6b41797535b01d49eaf021 Mon Sep 17 00:00:00 2001 From: Frank Crawford Date: Tue, 6 Apr 2021 21:12:58 +1000 Subject: [PATCH] Add patch to remove CMDEND from cron service --- cron.patch | 14 ++++++++++++++ logwatch.spec | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 cron.patch diff --git a/cron.patch b/cron.patch new file mode 100644 index 0000000..e58e572 --- /dev/null +++ b/cron.patch @@ -0,0 +1,14 @@ +diff --git a/scripts/services/cron b/scripts/services/cron +index 869b515..45b857f 100644 +--- a/scripts/services/cron ++++ b/scripts/services/cron +@@ -63,6 +63,9 @@ while (defined($ThisLine = )) { + if ($ThisLine =~ s/^CMD \((.+)\)\s*$/$1/) { + $Runs->{$User}->{$ThisLine}++; + $ExecutedCommand{$PID} = {command=>$ThisLine, user=>$User}; ++ } elsif ($ThisLine =~ /^CMDEND/) { ++ # Ignore - already counted above ++ next; + } elsif ($ThisLine =~ s/^CMD FINISH \((.+)\)\s*$/$1/) { + $Runs->{$User}->{$ThisLine}++; + } elsif ($ThisLine =~ s/^(END|CMD START) \((.+)\)\s*$/$1/) { diff --git a/logwatch.spec b/logwatch.spec index 0067a92..c252fe9 100644 --- a/logwatch.spec +++ b/logwatch.spec @@ -2,11 +2,13 @@ Summary: A log file analysis program Name: logwatch Version: 7.5.5 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: https://sourceforge.net/projects/logwatch Source0: logwatch-%{version}.tar.gz #Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz +# Ignore CMDEND lines in 7.5.5 until next release +Patch0: cron.patch BuildRequires: perl-generators Requires: grep mailx Requires: perl(Date::Manip) @@ -30,6 +32,7 @@ of the package on many systems. %prep %setup -q +%patch0 -p1 %build @@ -124,6 +127,9 @@ echo "# Configuration overrides for specific logfiles/services may be placed her %{_unitdir}/logwatch.timer %changelog +* Tue Apr 06 2021 Frank Crawford - 7.5.5-2 +- Add patch to remove CMDEND from cron service + * Tue Jan 26 2021 Frank Crawford - 7.5.5-1 - Update to 7.5.5