Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 8ff15aaec6aa7c6a6bfade293a2cfbaa > files > 26

logwatch-7.3.6-55.fc13.src.rpm

diff -up logwatch-7.3.6/scripts/services/init.pom logwatch-7.3.6/scripts/services/init
--- logwatch-7.3.6/scripts/services/init.pom	2006-12-20 16:25:09.000000000 +0100
+++ logwatch-7.3.6/scripts/services/init	2008-08-26 12:58:15.000000000 +0200
@@ -34,6 +34,9 @@ while (defined($ThisLine = <STDIN>)) {
 	   chomp ($ThisLine);
 	   $ReExecInit++;
    }
+   elsif ( ($Name,$Cause) = ($ThisLine =~ /(.*) main process \([0-9]*\) killed by (.*) /)) {
+       $ProcessKilled{"$Name,$Cause"}++;
+   }
    else {
       # report any unmatched entries
       push @OtherList,$ThisLine;
@@ -45,10 +48,19 @@ if ((keys %RunLevel) and ($Detail >= 10)
       print "   Entered or switched to runlevel " . $Level . ": " . $RunLevel{$Level} . " Time(s)\n";
    }
 }
+
 if ($ReExecInit) {
 	print "\n\nRe-execs of init: $ReExecInit times\n";
 }
 
+if ((keys %ProcessKilled) and ($Detail >=10)) {
+   print "\nKilled processses:\n";
+   foreach (keys %ProcessKilled) {
+      my ($Name,$Cause)=split ",";
+      print "   Process " . $Name. " killed by " . $Cause . ": " . $ProcessKilled{"$Name,$Cause"} . " Time(s)\n";
+   }
+}
+
 if ($#OtherList >= 0) {
    print "\n**Unmatched Entries**\n";
    print @OtherList;