cron script patch

Ivana Varekova <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
I'm going through fedora logwatch patches and this one is not in 
upstream branch so I'm sending it here.

Ivana Varekova

_______________________________________________
Logwatch-Devel mailing list
[email protected]
http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
cron.patch (text/x-patch, 2.1 KB)
diff -up ./cron.orig ./cron
--- ./cron.orig	2008-12-16 10:55:34.000000000 +0100
+++ ./cron	2008-12-16 12:04:50.000000000 +0100
@@ -127,7 +127,9 @@ while (defined($ThisLine = <STDIN>)) {
       ($ThisLine =~ /loading (system|user) tables/) or
       ($ThisLine =~ /loading table .*/) or 
       ($ThisLine =~ /void Inotify::Remove\(InotifyWatch\*\): removing watch failed/) or 
-      ($ThisLine =~ /error: \(22\) Invalid argument/)
+      ($ThisLine =~ /error: \(22\) Invalid argument/) or 
+      ($ThisLine =~ /INFO \(running with inotify support\)/) or 
+      ($ThisLine =~ /INFO \(\@reboot jobs will be run at computer's startup.\)/) 
    ) {
       # Ignore
    } elsif (
@@ -234,6 +236,12 @@ while (defined($ThisLine = <STDIN>)) {
    } elsif (( ($Error) = ($ThisLine =~ /ERROR: (failed to change SELinux context)/)) or
            (($Error) = ($ThisLine =~ /ERROR:(Could not set exec context to .* for .*)/))) {
       $SELCONTErr{$Error}++;
+   } elsif ($ThisLine =~ /FAILED to authorize user with PAM \(User not known to the underlying authentication module\)/) { 
+      $PAMAUTHErr++; 
+   } elsif ( ($FileName,$Cause) = ($ThisLine =~ /ERROR chdir failed \((.*)\): (.*)/) ) { 
+      $CHDIRErr{"$FileName,$Cause"}++; 
+   } elsif ($ThisLine =~ /ERROR \(failed to change user\)/) { 
+      $CHUSERHErr++;   
    } else {
       # Report any unmatched entries...
       push @OtherList, "$ThisLine\n";
@@ -376,10 +384,28 @@ if (%INCRONDErr) {
 if (%SELCONTErr) {
   printf "\n  SELinux context error \n";
   for $key (keys %SELCONTErr) {
-    print "    " . $key . ": " . $SELCONTErr{$key} . "time(s)\n";
+    print "    " . $key . ": " . $SELCONTErr{$key} . " time(s)\n";
   }
 }
 
+if ($PAMAUTHErr) {
+   printf "\nPAM autentification error: " . $PAMAUTHErr . " time(s)\n";
+}
+
+if (%CHDIRErr) {
+  printf "\nchdir command failed\n";
+  foreach (keys %CHDIRErr) {
+    my ($File,$Cause) = split ",";
+    print "    for directory " . $File . " (" . $Cause . ")". ": " . $CHDIRErr{"$File,$Cause"} . " time(s)\n";
+  }
+}
+
+if ($CHUSERHErr) {
+   printf "\nUser change error: " . $CHUSERHErr . " time(s)\n";
+}
+
+
+
 
 if ($#OtherList >= 0) {
    print "\n**Unmatched Entries**\n";
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.