<!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>&nbsp;</DIV>
<DIV>Here is the error in the maillog:</DIV>
<DIV>&nbsp;</DIV>
<DIV>ClamAV-autoupdate[18219]: ClamAV updater /usr/local/bin/freshclam cannot be 
run</DIV>
<DIV>&nbsp;</DIV>
<DIV>First, where is freshclam located.</DIV>
<DIV>&nbsp;</DIV>
<DIV># which freshclam<BR>/usr/bin/freshclam<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>Ok, so the third column in the virus.scanner.conf file needs to be just 
"/usr"</DIV>
<DIV>&nbsp;</DIV>
<DIV>I checked the virus.scanner.conf</DIV>
<DIV>clamav&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
/usr/lib/MailScanner/clamav-wrapper&nbsp;&nbsp;&nbsp;&nbsp; /usr</DIV>
<DIV>&nbsp;</DIV>
<DIV>Ok, the third parameter was set correctly.</DIV>
<DIV>&nbsp;</DIV>
<DIV>perform&nbsp;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>&nbsp;</DIV>
<DIV>ClamAV-autoupdate[19672]: ClamAV updater /usr/local/bin/freshclam cannot be 
run</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</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.&nbsp; See line 58.</DIV>
<DIV>line 56&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # echo Updating 
$NAME<BR>line&nbsp;57&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logger -p 
mail.info -t update.virus.scanners Running autoupdate for 
$NAME<BR>line&nbsp;58&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${UPDATER} 
"${PACKAGEDIR}" "${LOCK}" &gt;/dev/null 2&gt;&amp;1</DIV>
<DIV>&nbsp;</DIV>
<DIV>Line 58 executes the clamav-autoupdate scipt in the MailScanner library, so 
lets look at that file.</DIV>
<DIV>&nbsp;</DIV>
<DIV>The clamav-autoupdate script shows&nbsp;that&nbsp;the directory hard coded 
and is not reading the passed in PACKAGEDIR variable.</DIV>
<DIV>&nbsp;</DIV>
<DIV>$PackageDir = "/usr/local";</DIV>
<DIV>&nbsp;</DIV>
<DIV>I&nbsp;changed the packageDir line so that if a parameter is passed in to 
use it otherwise set it to "/usr/local"</DIV>
<DIV>&nbsp;</DIV>
<DIV>$PackageDir = shift || "/usr/local";</DIV>
<DIV>&nbsp;</DIV>
<DIV>Re-test</DIV>
<DIV>clamav-autoupdate /usr /tmp</DIV>
<DIV>&nbsp;</DIV>
<DIV>ClamAV-autoupdate[18880]: ClamAV updated</DIV>
<DIV>&nbsp;</DIV>
<DIV>Perfect and fixes my issue.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>