[Logcheck-devel] Bug#441388: Bug#441388: logtail2 doesn't work if no archived logs found

2007-09-09 Thread Marc Haber
On Sun, Sep 09, 2007 at 12:37:17PM +0100, Zoe Parsons wrote:
 [EMAIL PROTECTED]:~# logtail2 -t /var/log/syslog
 Cannot get /var/log/syslog.1.gz mtime: No such file or directory

Does the following patch help?

diff -urN logcheck-1.2.61/src/detectrotate/10-savelog.dtr 
logcheck/src/detectrotate/10-savelog.dtr
--- logcheck-1.2.61/src/detectrotate/10-savelog.dtr 2007-08-23 
13:44:27.0 +0200
+++ logcheck/src/detectrotate/10-savelog.dtr2007-09-09 16:56:59.0 
+0200
@@ -3,7 +3,7 @@
 sub {
   my ($filename) = @_;
   my $rotated_filename=;
-  if (-e $filename.0  (mtime($filename.0)  mtime($filename.1.gz)) ) {
+  if (-e $filename.0  -e $filename.1.gz  (mtime($filename.0)  
mtime($filename.1.gz)) ) {
 # assume the log is rotated by savelog(8)
 # syslog-ng leaves old files here
 $rotated_filename=$filename.0;
diff -urN logcheck-1.2.61/src/logtail2 logcheck/src/logtail2
--- logcheck-1.2.61/src/logtail22007-08-23 13:44:27.0 +0200
+++ logcheck/src/logtail2   2007-09-09 16:58:00.0 +0200
@@ -122,7 +122,7 @@
 #} else {
 #  print no rotated file found\n;
 #}
-if ($rotated_filename  inode($rotated_filename) == $inode) {
+if ($rotated_filename  -e $rotated_filename  
inode($rotated_filename) == $inode) {
   return $rotated_filename;
 } else {
   return ;

Greetings
Marc

-- 
-
Marc Haber | I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things.Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190



___
Logcheck-devel mailing list
Logcheck-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/logcheck-devel


[Logcheck-devel] Bug#441388: Bug#441388: logtail2 doesn't work if no archived logs found

2007-09-09 Thread Zoe Parsons
Yeah, that seems to do the trick. Thanks for the fast help. :-)

ZoeP




___
Logcheck-devel mailing list
Logcheck-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/logcheck-devel