Linux - Server This forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
05-03-2009, 10:58 AM
#1
LQ Newbie
Registered: Apr 2005
Posts: 20
Rep:
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.
05-03-2009, 11:07 AM
#2
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware current
Posts: 8,460
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.
05-03-2009, 12:03 PM
#3
LQ Newbie
Registered: Apr 2005
Posts: 20
Original Poster
Rep:
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.
05-03-2009, 12:09 PM
#4
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware current
Posts: 8,460
You can set in logrotate not to compress the files.
05-03-2009, 01:08 PM
#5
LQ Newbie
Registered: Apr 2005
Posts: 20
Original Poster
Rep:
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.
05-03-2009, 01:27 PM
#6
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware current
Posts: 8,460
Quote:
I think the code could manipulate compressed log files.
why do you think that ?
05-03-2009, 01:35 PM
#7
LQ Newbie
Registered: Apr 2005
Posts: 20
Original Poster
Rep:
Hello,
I think that way, it'll satisfy more people.
Cheers,
cviniciusm.
05-03-2009, 01:37 PM
#8
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware current
Posts: 8,460
Ah, you mean:
should manipulate compressed log files.
05-03-2009, 01:42 PM
#9
LQ Newbie
Registered: Apr 2005
Posts: 20
Original Poster
Rep:
Yes.
Sorry for any inconvenience.
Thread Tools
Search this Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 12:16 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News