Fwd: Patches to init

"Kirk Bauer" <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
---------- Forwarded message ----------
From: Orion Poplawski <[email protected]>
Date: Fri, Mar 7, 2008 at 9:28 AM
Subject: Patches to init
To: [email protected]


Attached is a patch to the init script that does:

 - Only outputs Re-execs of init if Detail is set.  I see this whenever
 glibc is updated and I think Detail = 0 should only output problems.

 - Handle some new init messages generated by upstart:

 Mar  5 17:30:30 bona init: rc5 main process (1521) killed by TERM signal
 Mar  6 13:31:36 bona init: tty4 main process (2439) killed by TERM signal

 Not sure what Detail level would be best.  You get them during a normal
 shutdown, but not sure if they would ever be indicative of a problem.


 --
 Orion Poplawski
 Technical Manager                     303-415-9701 x222
 NWRA/CoRA Division                    FAX: 303-415-9702
 3380 Mitchell Lane                  [email protected]
 Boulder, CO 80301              http://www.cora.nwra.com



-- 
Kirk Bauer <[email protected]>
http://linux.kaybee.org | www.logwatch.org
Author, Automating UNIX & Linux Administration

_______________________________________________
Logwatch-Devel mailing list
[email protected]
http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
init.patch (text/x-patch, 912 B)
--- scripts/services/init	2008-02-04 12:36:51.000000000 -0700
+++ /usr/share/logwatch/scripts/services/init	2008-03-07 09:24:15.000000000 -0700
@@ -34,6 +34,9 @@
 	   chomp ($ThisLine);
 	   $ReExecInit++;
    }
+   elsif ( $ThisLine =~ /(\w+) main process \(\d+\) killed by TERM signal/ ) {
+      $Killed{$1}++;
+   }
    else {
       # report any unmatched entries
       push @OtherList,$ThisLine;
@@ -45,9 +48,14 @@
       print "   Entered or switched to runlevel " . $Level . ": " . $RunLevel{$Level} . " Time(s)\n";
    }
 }
-if ($ReExecInit) {
+if ($ReExecInit and $Detail) {
 	print "\n\nRe-execs of init: $ReExecInit times\n";
 }
+if ((keys %Killed) and ($Detail >= 10)) {
+   foreach $Process (sort keys %Killed) {
+      print "   " . $Process . " main process killed by TERM signal : " . $Killed{$Process} . " 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.