On Saturday 07 February 2004 06:31 pm, Erik Bourget wrote:
> Hello;
>
> I've got clamd processing a ton of mail, it does a good job not crashing
> these days (cvs as of a week or so ago), but the new problem is as bad or
> worse - the hanging.  At least when it crashed, supervise (I'm running it
> under daemontools) could restart it.  Does anybody have a clean way to
> detect clamd failure and kill it if it happens?  Ideally this would be a
> process that I could put in between supervise and clamd that would exit on
> clamd failure.
>
> Barring a canned solution:
> I've got clamd on a system.  How do I detect that it is hung, apart from
> "clamdscan never returns"?   Magic with the .ctl file?

I'm using a program called "monit" (http://www.tildeslash.com/monit/), and it 
works great. It connects to the port and makes sure it's open, checks if the 
process is a zombie, and does some memory and load avg. checks. Here's my 
monit config snippet for clamav:

check process clamd with pidfile /var/run/clamd.pid
    start program = "/etc/init.d/clamav start"
    stop program  = "/usr/bin/killall -9 clamd"
    if failed host 127.0.0.1 port 3310 then restart
    if memory is greater than 5% then restart
    if loadavg(1min) is greater than 10.0 then restart
    alert [EMAIL PROTECTED]


If you're using Unix sockets, it'll connect to that too.
-- 
Matt
Systems Administrator
Local Access Communications
360.330.5535


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users

Reply via email to