PROBLEM
My ClamAV is not always running.
ENVIRONMENT
- On-Premise Server + WebMail Installations: Version 6.0 > Current Version
CAUSE
ClamAV, at times, fails and puts mail delivery and the processing of emails in the spool to a stop. This can be avoided by using ClamAV with supervise, a Unix tool that comes with the daemontools (http://cr.yp.to/daemontools.html) package, which basically checks if a service is running, then re-runs it if found inactive.
Implementing supervise with ClamAV is pretty straightforward. Just go through the following steps:
RESOLUTION
- Download daemontools (http://cr.yp.to/daemontools/daemontools-0.76.tar.gz), and install it on your server
- Add the following to your
/etc/inittab
file:
SV:123456:respawn:/command/svscanboot
- Create the ClamAV supervise log directory:
% mkdir /usr/local/atmail/av/supervise/log
- Create a file (with 755 permissions) called
/usr/local/atmail/av/supervise/run
, and place the following inside it:
#!/bin/sh
/usr/local/atmail/av/sbin/clamd - Create a file (with 755 permissions) called
/usr/local/atmail/av/supervise/log/run
, and place the following inside it:
#!/bin/sh
exec setuidgid root multilog s100000 n20 ./clamd - Link the ClamAV supervice directory to the
/service
directory:
% ln -s /usr/local/atmail/av/supervise/ /service/clamd
- Run svstat for ClamAV:
% svstat clamd
This should then have ClamAV run alongside supervise, and auto-regenerate if found inactive.
Comments