LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-03-2009, 10:58 AM   #1
cviniciusm
LQ Newbie
 
Registered: Apr 2005
Posts: 20

Rep: Reputation: 0
Question amavis-stats issue - not running.


Hello,

I was using amavis-stats without errors on Ubuntu 9.04, but after I installed pflogsumm package, the issue below is ocurring:
"amavis-stats: error: Could not open rotated logfile.
amavis-stats: error: Tried extentions .0, .1, .01, -20090503, -20090502
amavis-stats: Logfile "/var/log/mail.info" appears to have rotated
"

"
# ls -l /etc/cron.d
-rw-r--r-- 1 root root 188 May 2 11:00 amavis-stats
"


How to solve this, please?


TIA,
cviniciusm.
 
Old 05-03-2009, 11:07 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Do you see the rotaded logfiles?
What is the extension?
Seems to me pflogsumm is renaming the files, and amavis-stats doesn't recognize them.
 
Old 05-03-2009, 12:03 PM   #3
cviniciusm
LQ Newbie
 
Registered: Apr 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Hello,

I think the amavis-stats script is not understanding the mail.log.1.gz file .

# ls -lt /var/log/mail*
-rw-r----- 1 root adm 154770 May 3 13:21 /var/log/mail.info
-rw-r----- 1 root adm 154770 May 3 13:21 /var/log/mail.log
-rw-r----- 1 root adm 6908 May 3 13:20 /var/log/mail.err
-rw-r----- 1 root adm 6961 May 3 13:20 /var/log/mail.warn
-rw-r----- 1 root adm 115787 May 3 06:22 /var/log/mail.info.1.gz
-rw-r----- 1 root adm 115787 May 3 06:22 /var/log/mail.log.1.gz
-rw-r----- 1 root adm 7708 May 3 04:10 /var/log/mail.err.1.gz
-rw-r----- 1 root adm 9721 May 3 04:10 /var/log/mail.warn.1.gz

# grep -i amavis /etc/group
adm:x:4:amavis-stats,amavis
amavis:x:113:clamav,amavis-stats

Any ideas, please?


Regards,
cviniciusm.
 
Old 05-03-2009, 12:09 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
You can set in logrotate not to compress the files.
 
Old 05-03-2009, 01:08 PM   #5
cviniciusm
LQ Newbie
 
Registered: Apr 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Hello,

I think the code could manipulate compressed log files.

Code:
/usr/sbin/amavis-stats :
"
...
sub parseRotFile {
    my ($logfile, $spos) = @_;

    my $now = time();
    my $today     = localtime($now);
    my $yesterday = localtime($now - 60*60*24);

    $today = sprintf("%4u%02u%02u", $today->year + 1900,
                                    $today->mon + 1,
                                    $today->mday);

    $yesterday = sprintf("%4u%02u%02u", $yesterday->year + 1900,
                                        $yesterday->mon + 1,
                                        $yesterday->mday);

    my $rotlogfile = undef;

    if (-f "$logfile.0") {
        $rotlogfile = $logfile . ".0";
    } elsif (-f "$logfile.1") {
        $rotlogfile = $logfile . ".1";
    } elsif (-f "$logfile.01") {
        $rotlogfile = $logfile . ".01";
    } elsif (-f "$logfile-$today") {
        $rotlogfile = $logfile . "-$today";
    } elsif (-f "$logfile-$yesterday") {
        $rotlogfile = $logfile . "-$yesterday";
    }

    if (defined($rotlogfile)) {
        parseFile ($rotlogfile, $spos, (stat $rotlogfile)[7]);
    } else {
        err("Could not open rotated logfile.");
        err("  Tried extentions .0, .1, .01, -$today, -$yesterday");
        do_exit(1);
    }
}
...
"

Regards,
cviniciusm.
 
Old 05-03-2009, 01:27 PM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
I think the code could manipulate compressed log files.
why do you think that ?
 
Old 05-03-2009, 01:35 PM   #7
cviniciusm
LQ Newbie
 
Registered: Apr 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Hello,

I think that way, it'll satisfy more people.


Cheers,
cviniciusm.
 
Old 05-03-2009, 01:37 PM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Ah, you mean:
should manipulate compressed log files.
 
Old 05-03-2009, 01:42 PM   #9
cviniciusm
LQ Newbie
 
Registered: Apr 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Yes.

Sorry for any inconvenience.
 
  


Reply

Tags
amavis, ubuntu, ubuntu904



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Amavisd Running - Amavis-milter is Not carlosinfl Linux - Server 2 06-18-2008 10:16 AM
issue running WINE Joey Cagle Grafpup 16 06-18-2007 10:27 PM
Running Kernel issue - display hb21l6 Linux - Kernel 5 01-27-2007 04:44 AM
Problem with amavis-stats Koven Linux - Software 1 02-23-2005 11:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration