[Logcheck-devel] Bug#453309: logtail ignores the -o (offset file) option

Heiko Schlittermann hs at schlittermann.de
Tue Feb 5 11:26:22 UTC 2008


Marc Haber <mh+debian-packages at zugschlus.de> (Di 05 Feb 2008 11:46:15 CET):
> On Wed, Nov 28, 2007 at 04:05:53PM +0100, Heiko Schlittermann wrote:
> > The logtail utility fails in using some alternative offset file
> > (passed via the '-o' option).
> 
> Please give an example how to reproduce the issue.

Hm. I can't. It seems to work:

    logtail -f <LOGFILE> -o <OFFSET>	    # works (according man page)

.. as documented. I think last time I supposed it should work that way
too:

    logtail -o <OFFSET> <LOGFILE>	    # doesn't work (doesn't fit
					      to manpage)

    logtail <LOGFILE>			    # works (but doesn't fit to manpage)
					    # but of course, no
					    # alternative offset file



So there is some inconsistency between the tool and the manpage.

Since I believe the last invocation is naturally, the last but one
should work too, shouldn't it? The first invocation is the only valid
(at least according to the man page)

And according to the source following works too:

    logtail <LOGFILE> <OFFSET>



I'll attach 2 diffs, both seem(!) to work for me. But I didn't touch the
man page so far.


    Best regards from Dresden
    Viele Grüße aus Dresden
    Heiko Schlittermann
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann HS12-RIPE -----------------------------------------
 gnupg encrypted messages are welcome - key ID: 48D0359B ---------------
 gnupg fingerprint: 3061 CFBF 2D88 F034 E8D2  7E92 EE4E AC98 48D0 359B -
-------------- next part --------------
32,42c32,34
< # try to detect plain logtail invocation without switches
< if (!$opts{f} && $#ARGV != 0 && $#ARGV != 1) {
<    print STDERR "No logfile to read. Use -f [LOGFILE].\n";
<    exit 66;
< } elsif ($#ARGV == 0) {
<    $logfile = $ARGV[0];
< } elsif ($#ARGV == 1) {
<    ($logfile, $offsetfile) = ($ARGV[0], $ARGV[1]);
< } else {
<    ($logfile, $offsetfile) = ($opts{f}, $opts{o});
< }
---
> ($logfile, $offsetfile) = @ARGV;
> $logfile = $opts{f} if defined $opts{f};
> $offsetfile = $opts{o} if defined $opts{o};
-------------- next part --------------
40,41d39
< } else {
<    ($logfile, $offsetfile) = ($opts{f}, $opts{o});
42a41,42
> $logfile = $opts{f} if defined $opts{f};
> $offsetfile = $opts{o} if defined $opts{o};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/logcheck-devel/attachments/20080205/6430f41a/attachment.pgp 


More information about the Logcheck-devel mailing list