• This forum has a zero tolerance policy regarding spam. If you register here to publish advertising, your user account will be deleted without further questions.

clamav / amavis funktionieren nicht / 100% cpu Last

madmax

New Member
Guten Tag,

wie es scheint will mich mein Mailserver ein wenig ärgern.
Nachdem ich bemerkt habe dass mein MySql Server extrem langsam ist,
habe ich mich auf meine Maschine verbunden und ein wenig rumgestöbert.
dabei habe ich bemerkt dass clamd fast 100% cpu beansprucht:
Code:
max@myhost:~$ top

top - 17:08:12 up 9 min,  1 user,  load average: 2.06, 1.82, 0.97
Tasks: 101 total,   4 running,  97 sleeping,   0 stopped,   0 zombie
Cpu(s): 84.7%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si, 15.3%st
Mem:    204984k total,   202348k used,     2636k free,     1044k buffers
Swap:   255992k total,    22764k used,   233228k free,    43092k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
12359 clamav    25   0 37732  31m  488 R 43.8 15.7   2:05.67 clamd              
12381 amavis    25   0 10780 6640 1084 R 41.1  3.2   0:59.34 clamscan           
    1 root      18   0  1776  620  532 S  0.0  0.3   0:01.21 init               
    2 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0        
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0        
    4 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0         
    5 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 events/0           
    6 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper            
    7 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kthread            
    9 root      10  -5     0    0    0 S  0.0  0.0   0:00.01 xenwatch           
   10 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 xenbus             
   16 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kblockd/0          
   17 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/0           
   20 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kseriod            
   84 root      15   0     0    0    0 S  0.0  0.0   0:00.00 pdflush            
   85 root      15   0     0    0    0 S  0.0  0.0   0:00.00 pdflush            
   86 root      10  -5     0    0    0 S  0.0  0.0   0:00.02 kswapd0
der Auszug von top ist übrigends nach einem Neustart entstanden der die Last aber nicht ändern konnte.
Hier die Logdateien bzw. auszüge davon:
/var/log/mail.log
Code:
Feb 25 17:05:54 myhost fetchmail[12157]: awakened at Mon Feb 25 17:05:54 2008 
Feb 25 17:05:55 myhost fetchmail[12157]: 1 message for eu425428 at pop.tele2.it (16549 octets). 
Feb 25 17:05:56 myhost postfix/smtpd[12366]: connect from localhost[127.0.0.1]
Feb 25 17:05:56 myhost postfix/smtpd[12366]: AD7D55C0D4: client=localhost[127.0.0.1]
Feb 25 17:05:56 myhost postfix/cleanup[12374]: AD7D55C0D4: message-id=<6A.5C.19205.7A6E2C74@vmta1.contactlab.it>
Feb 25 17:05:56 myhost fetchmail[12157]: reading message eu425428@pop.tele2.it:1 of 1 (16549 octets) flushed 
Feb 25 17:05:56 myhost postfix/qmgr[11957]: AD7D55C0D4: from=<2763211.1718.1000117@c.contactlab.it>, size=16857, nrcpt=1 (queue active)
Feb 25 17:05:56 myhost postfix/smtpd[12366]: disconnect from localhost[127.0.0.1]
Feb 25 17:05:56 myhost fetchmail[12157]: sleeping at Mon Feb 25 17:05:56 2008 for 300 seconds 
Feb 25 17:05:58 myhost amavis[11715]: (11715-01) (!) /usr/bin/clamscan is taking longer than 315 s and will be killed
Feb 25 17:05:58 myhost amavis[11715]: (11715-01) (!) killing process [12042] running /usr/bin/clamscan
Feb 25 17:05:58 myhost amavis[11715]: (11715-01) (!) run_av: timed out
Feb 25 17:05:58 myhost amavis[11715]: (11715-01) (!!) ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan timed out at (eval 48) line 462.
Feb 25 17:05:58 myhost amavis[11715]: (11715-01) (!!) TROUBLE in check_mail: virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 48) line 268.; ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan timed out at (eval 48) line 462.
Feb 25 17:05:58 myhost amavis[11715]: (11715-01) (!) PRESERVING EVIDENCE in /var/lib/amavis/tmp/amavis-20080225T170036-11715
Feb 25 17:05:58 myhost postfix/smtp[11960]: 70E6F5C0BD: to=<fetchmail.myhost@localhost>, relay=127.0.0.1[127.0.0.1]:10024, delay=1088, delays=766/0.14/0.01/323, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing, id=11715-01, virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 48) line 268.; ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan timed out at (eval 48) line 462. (in reply to end of DATA command))
Feb 25 17:05:58 myhost amavis[11716]: (11716-01) (!) ClamAV-clamd: Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory, retrying (2)
Feb 25 17:06:04 myhost amavis[11716]: (11716-01) (!!) ClamAV-clamd av-scanner FAILED: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 48) line 268.
Feb 25 17:06:05 myhost amavis[11716]: (11716-01) (!!) WARN: all primary virus scanners failed, considering backups
Feb 25 17:10:56 myhost fetchmail[12157]: awakened at Mon Feb 25 17:10:56 2008 
Feb 25 17:10:57 myhost fetchmail[12157]: sleeping at Mon Feb 25 17:10:57 2008 for 300 seconds 
Feb 25 17:11:20 myhost amavis[11716]: (11716-01) (!) /usr/bin/clamscan is taking longer than 315 s and will be killed
Feb 25 17:11:20 myhost amavis[11716]: (11716-01) (!) killing process [12381] running /usr/bin/clamscan
Feb 25 17:11:20 myhost amavis[11716]: (11716-01) (!) run_av: timed out
Feb 25 17:11:20 myhost amavis[11716]: (11716-01) (!!) ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan timed out at (eval 48) line 462.
Feb 25 17:11:20 myhost amavis[11716]: (11716-01) (!!) TROUBLE in check_mail: virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 48) line 268.; ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan timed out at (eval 48) line 462.
Feb 25 17:11:20 myhost amavis[11716]: (11716-01) (!) PRESERVING EVIDENCE in /var/lib/amavis/tmp/amavis-20080225T170557-11716
Feb 25 17:11:20 myhost postfix/smtp[12375]: AD7D55C0D4: to=<fetchmail.myhost@localhost>, relay=127.0.0.1[127.0.0.1]:10024, delay=324, delays=0.15/0.01/0.36/323, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing, id=11716-01, virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 48) line 268.; ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan timed out at (eval 48) line 462. (in reply to end of DATA command))
/var/log/mail.err
Code:
eb 25 16:57:46 myhost amavis[12706]: (12706-05) (!!) TROUBLE in process_request: Error writing a SMTP response to the socket: Broken pipe at (eval 45) line 788, <GEN54> line 32.
Feb 25 17:00:43 myhost amavis[11715]: (11715-01) (!!) ClamAV-clamd av-scanner FAILED: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 48) line 268.
Feb 25 17:00:43 myhost amavis[11715]: (11715-01) (!!) WARN: all primary virus scanners failed, considering backups
Feb 25 17:05:58 myhost amavis[11715]: (11715-01) (!!) ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan timed out at (eval 48) line 462.
Feb 25 17:05:58 myhost amavis[11715]: (11715-01) (!!) TROUBLE in check_mail: virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 48) line 268.; ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan timed out at (eval 48) line 462.
Feb 25 17:06:04 myhost amavis[11716]: (11716-01) (!!) ClamAV-clamd av-scanner FAILED: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 48) line 268.
Feb 25 17:06:05 myhost amavis[11716]: (11716-01) (!!) WARN: all primary virus scanners failed, considering backups
Feb 25 17:11:20 myhost amavis[11716]: (11716-01) (!!) ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan timed out at (eval 48) line 462.
Feb 25 17:11:20 myhost amavis[11716]: (11716-01) (!!) TROUBLE in check_mail: virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 48) line 268.; ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan timed out at (eval 48) line 462.

Ich sehe darin zwar dass es ein Problem mit dem Socket gibt, weiss aber nicht wie ich es lösen kann da ich am scanner nichts geändert habe.

Wäre nett wenn mir jemand helfen kann die Last vom Server zu nehmen.

Viele Grüße
madmax
 
Verschickt dein Server denn sehr viele oder sehr große Emails? Sieht fast so aus, als wäre der überlastet
 
Verschickt dein Server denn sehr viele oder sehr große Emails? Sieht fast so aus, als wäre der überlastet

Nein macht er eigentlich nicht. Ca. 30 Mails werden pro Tag darüber empfangen/versendet, alles reine Text Mails ohne große Anhänge.
Also nichts was den Server überlasten sollte.
Und komisch ist dass aktuell amavis / clamd gerade vor sich hinidlen, der Spuk ist also wider weck. Nur würde ich gerne der Ursache auf den Grund gehen um es
das nächste Mal zu vermeiden. Auserdem binn ich mir nicht sicher ob Viruse / Spams gerade abgewehrt werden.

madmax
 
Das verwundert mich ein wenig:
Code:
Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory
Welche Linux Distribution setzt du ein? Nicht zufällig Debian etch?
 
... Nicht zufällig Debian etch?
doch, ich benutze Debian 4.0 Etch minimal auf einem vServer von vsell.de der mit Xen virtualisiert wird. Ansonsten habe ich aber keine Probleme mit Leistungsschwierigkeiten damit.

Aber wie ich nach weiterem Nachforschen herausgefunden habe laufen noch andere "Kleinigkeiten" bei meinem Mailserver nicht rund.

einmal wäre da dass nichts mehr in die mail.log geschrieben wird, nachdem logrotate sie bearbeitet hat.
hier der Teil der logrotate:
Code:
/var/log/mail.log {
    missingok
    daily
    size 5M
    rotate 7
    create 0664 root
    postrotate
    /etc/init.d/postfix reload 2> /dev/null > /dev/null || true
    endscript
    compress
    start 0
}

hier sieht man es anhand der Zeit:
Code:
myhost:/home/max# ls -al /var/log/mail.log*
-rw-r----- 1 root adm     0 Feb 26 06:32 /var/log/mail.log
-rw-r----- 1 root adm 56634 Feb 26 06:27 /var/log/mail.log.0
-rw-r----- 1 root adm 16809 Feb 25 06:32 /var/log/mail.log.1.gz
-rw-r----- 1 root adm  1535 Feb 24 01:57 /var/log/mail.log.2.gz
-rw-r----- 1 root adm  2232 Feb 23 01:04 /var/log/mail.log.3.gz
-rw-r----- 1 root adm  1708 Feb 22 04:20 /var/log/mail.log.4.gz
-rw-r----- 1 root adm  1278 Feb 21 01:04 /var/log/mail.log.5.gz
-rw-r----- 1 root adm  1344 Feb 20 01:04 /var/log/mail.log.6.gz

des weiteren scheint Spamassasin nicht zu funktionieren, genaueres kann ich aber nicht sagen da nichts ins Log geschrieben wird, auch nocht ins mail.err
z.B. werden solche Mails durchgelassen:
Code:
Return-Path: <elmobegay9320@yahoo.co.uk>
Delivered-To: max@meinedomain.tld
Received: by myhost.meinedomain.tld (Postfix)
	id 209CA5C0C1; Tue, 26 Feb 2008 15:09:29 +0100 (CET)
Delivered-To: fetchmail.myhost@localhost
Received: from localhost (localhost [127.0.0.1])
	by myhost.meinedomain.tld (Postfix) with ESMTP id 0C17E5C0D9
	for <fetchmail.myhost@localhost>; Tue, 26 Feb 2008 15:09:29 +0100 (CET)
X-Quarantine-ID: <8SifCnlQcBXQ>
X-Virus-Scanned: Debian amavisd-new at meinedomain.tld.
Received: from myhost.meinedomain.tld ([127.0.0.1])
	by localhost (meinedomain.tld [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 8SifCnlQcBXQ for <fetchmail.myhost@localhost>;
	Tue, 26 Feb 2008 15:09:17 +0100 (CET)
Received: from meinedomain.tld (localhost [127.0.0.1])
	by myhost.meinedomain.tld (Postfix) with ESMTP id E95C85C0C1
	for <fetchmail.max@localhost>; Tue, 26 Feb 2008 15:09:16 +0100 (CET)
X-T2-Real-To: <meine2temailadresse@tele2.it>
X-Cloudmark-Score:   0.000000 []
Received: from pop.tele2.it [212.247.156.13]
	by meinedomain.tld with POP3 (fetchmail-6.3.6)
	for <fetchmail.myhost@localhost> (single-drop); Tue, 26 Feb 2008 15:09:17 +0100 (CET)
Received: from n18.bullet.mail.mud.yahoo.com ([68.142.201.235] verified)
  by mailfe15.swip.net (CommuniGate Pro SMTP 5.1.13)
  with SMTP id 85807622 for myhost@tele2.it; Tue, 26 Feb 2008 15:09:03 +0100
Received: from [68.142.200.225] by n18.bullet.mail.mud.yahoo.com with NNFMP; 26 Feb 2008 14:09:02 -0000
Received: from [68.142.201.242] by t6.bullet.mud.yahoo.com with NNFMP; 26 Feb 2008 14:08:37 -0000
Received: from [127.0.0.1] by omp403.mail.mud.yahoo.com with NNFMP; 26 Feb 2008 14:09:02 -0000
X-Yahoo-Newman-Id: 700690.45854.bm@omp403.mail.mud.yahoo.com
Message-ID: <700690.45854.bm@omp403.mail.mud.yahoo.com>
Received: (qmail 51232 invoked from network); 26 Feb 2008 14:01:56 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.co.uk;
  h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Reply-To:Subject:Date:MIME-Version:Content-type:Content-transfer-encoding;
  b=VH2Scmn++4vN503vVgYoO0pbewuBEFFci0AHs58+6kfCyXFZF3MFcnZbH5JmlEw/HYfdyhFUZ+WrqJ8a91OhM0e67CItM50DTLGV4hBXPacuZXn/6wZs+Yial1oSCe2+/7RlmPS1u3kMNSxkU23WQA4yi6C7ZDhQ/caRupJEh2E=  ;
Received: from unknown (HELO www.microsoft.com) (elmobegay9320@78.51.103.8 with login)
  by smtp125.plus.mail.mud.yahoo.com with SMTP; 26 Feb 2008 14:01:55 -0000
X-YMail-OSG: OYr8mdIVM1mzobpWVaibBKLSZeUTz6MR6WBTCatl5zRjT7wPHtZqsy_BXdaH_x1tE43vviwE6Q--
X-Yahoo-Newman-Property: ymail-5
From: elmobegay9320@yahoo.co.uk
To: maxsteven55@msn.com
Reply-To: elmobegay9320@yahoo.co.uk
Subject: erotic rg m hwfp Schoolgirl mr eohz .
Date: Tue, 26 Feb 2008 01:14:45 -0600
MIME-Version: 1.0
Content-type: text/plain; charset=windows-1251
Content-transfer-encoding: 8bit

drmxv, fine v wp q Girlfriend khz gxjc v http://www.fastvidevos.cn xk rts ozpks pt. gfq sz vxnf tt q.
dntgf zgiwv qy vzuh jhg iarj, k htkdu vny t sp.
Ich kann im Header nicht erkennen dass Spamassasin da X-Spam-Flag oder sonstwas gesetzt hat.

Können diese Probleme alle zusammenhängen?
Meinen Mailserver habe ich nach diesem HowTo eingerichtet:
Howto: ISP-style Email Server with Debian-Etch and Postfix 2.3

Grüße
madmax
 
Ich hatte den selben Fehler (Can't connect to....clam.ctl) und ich bin fast verzweifelt bei der Fehlersuche.

Nach langem Suchen stellte sich raus, dass die ClamAV Version von Debian Etch etwas buggy ist und dass man die Updaten sollte. Füge in deiner sources.list mal folgendes hinzu:
Code:
deb http://volatile.debian.org/debian-volatile etch/volatile main
Dannach ein: apt-get install clamav
 
Füge in deiner sources.list mal folgendes hinzu:
Code:
deb http://volatile.debian.org/debian-volatile etch/volatile main
Dannach ein: apt-get install clamav
Danke das habe ich jetzt gemacht, kann dir aber leider nicht sagen ob es was genutzt hat, in der mail.log sowie mail.err wird schon seit ca.12 Stunden nichts mehr gelogt, auch nach Neustart nicht, in die mail.inf wird gelogt, aber nur wer seine Mails abruft. Und Spamassasin scheint seine Arbeit auch nicht zu machen, aber ohne Logs kann ich das schwer nachvollziehen.

Grüße
~madmax
 
erstmal ein "apt-get update"

Hallo,

habe ich natürlich zuerst gemacht, iich war aber leider etwas unachtsam und habe übersehen dass es Probleme mit dem publik key gegeben hat. Jetzt funktioniert die Quelle aber und nach einem erfolgreichen update bekomme ich:
Code:
myhost:/home/max# apt-get install clamav
Reading package lists... Done
Building dependency tree... Done
clamav is already the newest version.
........

das scheint also schon zu passen, aber irgendwo hakt es immer noch.
Und das wirklich mysteriöse an der Sache ist dass postfix wider Logfiles schreibt :)
aber auch darin findet sich nichts.

Das ist wirklich alles sehr komisch, und ich weis auch nicht mehr wo ich noch weitersuchen sollte.

~madmax
 
Hi,

probiere mal den clamd direkt aufzurufen. Wahrscheinlich bekommst Du dann einen Hinweis auf Konfigurationsfehler in der /etc/clamav/clamd.conf. Dort kommentierst Du alle Option mit einem FALSE am Ende aus und bei allen TRUE nimmst Du das TRUE dahinter weg. Ein paar Optionen werden noch angemeckert, weil diese evtl. inzwischen selbstverständlich oder aber nicht mehr unterstützt werden.

Danach läufts wieder.

Gruß

Stefan
 
Habe dasselbe Problem .... der hat 100 % CPU Last weil der Clamd die Virendefinition am einlesen ist und das schon sehr langsam, während dieser Zeit hat er die CTL bzw. SOCK datei noch nicht angelegt, der ClamScan der vom Amavis dann bereits gestartet wird, hängt dann faktisch hinten dran und kann auch nicht schneller scannen, egal wie winzig die Mail ist.

Dass muss am Etch Stable 0.90.1 Clamav release liegen und an den aktuellen clamav virendefinitionen, vor allem wenn der freshclam jedesmal ein neues update bekommt, fängt dieser murks wieder von vorne an. Musste in der amavis conf jetzt vorrübergehend erstmal die virenscanner also clamav deaktivieren, sonst platzt der server.

hoffe das die debian jungs mal bald die 0.92.x nachziehen von clamav
 
Hatte jetzt mal vorrübergehend in die sources.list

Code:
deb http://volatile.debian.org/debian-volatile etch/volatile main

reingepackt, dann nen apt-get update und apt-get install auf
clamav-daemon
clamav-freshclam
clamav-base und
clamav gemacht.

dann den eintrag in der sources.list wieder rausgenommen, damit konnte ich die zuvor genannten clamav volatile distribution 0.92.1 installieren und siehe da ....
die signaturen wurden anstatt in 60 minuten in nur noch 6 sekunden eingelesen ....

clamd scheint jetzt damit erstmal zu fluppen ....

gruss,
da zero:D
 
Last edited by a moderator:
Back
Top