[Mimedefang] patch - handle hung clamav gracefully

Chris Myers chris at by-design.net
Fri Aug 20 15:26:12 EDT 2004


My clamd process hung today for reasons unknown and took MIMEDefang along
with it.  There was nothing in any of the clamav logfiles, the hourly
database integrity checks just stopped happening and clamd wasn't responding
to scan requests... :-(

Since the message_contains_virus_clamd() function doesn't have timeouts, all
of the mimedefang processes were stuck waiting for clamd to respond to the
PING/PONG sequence until they got killed off by the multiplexor. <repeat>
<repeat> <repeat ad nauseum>

Attached is a patch which adds a 5-second timeout to the PING/PONG process
when talking to clamd.  If clamd doesn't respond in that timeframe, the
routine now properly returns a "cannot-execute" status.

Chris Myers
Networks By Design
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mimedefang-2.44-clamd.patch
Type: application/octet-stream
Size: 1481 bytes
Desc: not available
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20040820/e31b3ca5/attachment-0002.obj>


More information about the MIMEDefang mailing list