<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7601.17785"></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Segoe UI">
<DIV dir=ltr align=left><SPAN class=299363817-17042012>My question is what is
the point of using the mailscanner updater when using clamd? why not just run
freshclamd or use a regular cron job? Mailscanner doesn't need to know when the
sigs are updated when using clamd</SPAN></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT face=Tahoma><B>From:</B> mailscanner-bounces@lists.mailscanner.info
[mailto:mailscanner-bounces@lists.mailscanner.info] <B>On Behalf Of </B>Brad
Beckenhauer<BR><B>Sent:</B> Tuesday, April 17, 2012 12:35 PM<BR><B>To:</B>
mailscanner@lists.mailscanner.info<BR><B>Subject:</B> clamav-autoupdate is not
reading the PACKAGEDIR variable<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>I recently switch from clamav to clamd on MailScanner 4.84.5 and found an
error message in the maillog and I wanted to share the discovery and my
fix:</DIV>
<DIV> </DIV>
<DIV>Here is the error in the maillog:</DIV>
<DIV> </DIV>
<DIV>ClamAV-autoupdate[18219]: ClamAV updater /usr/local/bin/freshclam cannot be
run</DIV>
<DIV> </DIV>
<DIV>First, where is freshclam located.</DIV>
<DIV> </DIV>
<DIV># which freshclam<BR>/usr/bin/freshclam<BR></DIV>
<DIV> </DIV>
<DIV>Ok, so the third column in the virus.scanner.conf file needs to be just
"/usr"</DIV>
<DIV> </DIV>
<DIV>I checked the virus.scanner.conf</DIV>
<DIV>clamav
/usr/lib/MailScanner/clamav-wrapper /usr</DIV>
<DIV> </DIV>
<DIV>Ok, the third parameter was set correctly.</DIV>
<DIV> </DIV>
<DIV>perform a manual check to see if the clamav-auto-update script was
working and found that it failed</DIV>
<DIV>clamav-autoupdate /usr /tmp</DIV>
<DIV> </DIV>
<DIV>ClamAV-autoupdate[19672]: ClamAV updater /usr/local/bin/freshclam cannot be
run</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Check the update_virus_scanners perl script and found that the script is
passing the PACKAGEDIR variable (which is extracted from the virus.scanners.conf
file) to the clamav-autoupdate script. See line 58.</DIV>
<DIV>line 56 # echo Updating
$NAME<BR>line 57 logger -p
mail.info -t update.virus.scanners Running autoupdate for
$NAME<BR>line 58 ${UPDATER}
"${PACKAGEDIR}" "${LOCK}" >/dev/null 2>&1</DIV>
<DIV> </DIV>
<DIV>Line 58 executes the clamav-autoupdate scipt in the MailScanner library, so
lets look at that file.</DIV>
<DIV> </DIV>
<DIV>The clamav-autoupdate script shows that the directory hard coded
and is not reading the passed in PACKAGEDIR variable.</DIV>
<DIV> </DIV>
<DIV>$PackageDir = "/usr/local";</DIV>
<DIV> </DIV>
<DIV>I changed the packageDir line so that if a parameter is passed in to
use it otherwise set it to "/usr/local"</DIV>
<DIV> </DIV>
<DIV>$PackageDir = shift || "/usr/local";</DIV>
<DIV> </DIV>
<DIV>Re-test</DIV>
<DIV>clamav-autoupdate /usr /tmp</DIV>
<DIV> </DIV>
<DIV>ClamAV-autoupdate[18880]: ClamAV updated</DIV>
<DIV> </DIV>
<DIV>Perfect and fixes my issue.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><BR></DIV>
<DIV> </DIV></BODY></HTML>