Odi's astoundingly incomplete notes
New entries | CodeRunning 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
Is mkpipe an OS specific thing?
Yes, mkpipe exists on certain distros. You can just as well use: mknod logpipe p
Add comment