clamav-autoupdate is not reading the PACKAGEDIR variable
Rick Cooper
rcooper at dwford.com
Tue Apr 17 18:39:46 IST 2012
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
_____
From: mailscanner-bounces at lists.mailscanner.info
[mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Brad
Beckenhauer
Sent: Tuesday, April 17, 2012 12:35 PM
To: mailscanner at lists.mailscanner.info
Subject: clamav-autoupdate is not reading the PACKAGEDIR variable
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:
Here is the error in the maillog:
ClamAV-autoupdate[18219]: ClamAV updater /usr/local/bin/freshclam cannot be
run
First, where is freshclam located.
# which freshclam
/usr/bin/freshclam
Ok, so the third column in the virus.scanner.conf file needs to be just
"/usr"
I checked the virus.scanner.conf
clamav /usr/lib/MailScanner/clamav-wrapper /usr
Ok, the third parameter was set correctly.
perform a manual check to see if the clamav-auto-update script was working
and found that it failed
clamav-autoupdate /usr /tmp
ClamAV-autoupdate[19672]: ClamAV updater /usr/local/bin/freshclam cannot be
run
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.
line 56 # echo Updating $NAME
line 57 logger -p mail.info -t update.virus.scanners Running
autoupdate for $NAME
line 58 ${UPDATER} "${PACKAGEDIR}" "${LOCK}" >/dev/null 2>&1
Line 58 executes the clamav-autoupdate scipt in the MailScanner library, so
lets look at that file.
The clamav-autoupdate script shows that the directory hard coded and is not
reading the passed in PACKAGEDIR variable.
$PackageDir = "/usr/local";
I changed the packageDir line so that if a parameter is passed in to use it
otherwise set it to "/usr/local"
$PackageDir = shift || "/usr/local";
Re-test
clamav-autoupdate /usr /tmp
ClamAV-autoupdate[18880]: ClamAV updated
Perfect and fixes my issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20120417/16294802/attachment.html
More information about the MailScanner
mailing list