[1681969 views]

[]

Odi's astoundingly incomplete notes

New entries | Code

Running clamd under daemontools

ClamAV's clamd can be run under the daemontools. Unfortunately most users patch clamd to support logging to stderr. This way you can use multilog to capture the log output. However patching clamd seems awkward and can not be done if you use a binary distribution.

You can instead use a pipe to transport the log from clamd to stderr. Create a log pipe:

cd /var/log/clamd/
mkpipe logpipe
chown clamav:clamav logpipe
chmod 640 logpipe

Configure clamd to log to the pipe by editing /etc/clamd.conf:

LogFile /var/log/clamd/logpipe
LogFileUnlock
LogTime
#LogFileMaxSize
#LogSyslog

The daemontools run script for clamd must be changed like this:

#!/bin/sh
exec /usr/sbin/clamd -c /etc/clamd.conf 2>&1 &
sleep 2
cat /var/log/clamd/logpipe

posted on 2005-02-25 10:38 UTC in Code | 2 comments | permalink
Is mkpipe an OS specific thing?
Yes, mkpipe exists on certain distros. You can just as well use: mknod logpipe p