Jesper,
I've just been investigating the exact same problem!
On Sun, 26 Oct 2008, Jesper Dybdal wrote:
> I have just installed clamav for use with amavisd-new. It works fine
> and the database is updated as it should, but each time frechclam
> updates the virus database it executes the OnUpdateExecute command not
> just once, but twice - so I get two mails for each update.
>
> Frechclam.conf contains:
> > OnUpdateExecute ps axuf | mailx -s "Clamav database update Ok" virusalert
>
> and freshclam is executed from cron by the following line:
> > 48 * * * * exec /bin/su clamav -c "freshclam --quiet"
[...]
> Have I done something wrong, or is this a bug?
I've come to the conclusion that it's a bug, introduced into
freshclam/execute.c in version 0.94
CAVEAT: this is conjecture, I have not tested this at all. But it fits the
symptoms - freshclam running from cron, rather than as a daemon. AFAICS it
would cause freshclam to run your command twice, once directly from
freshclam, and once from a forked child process.
You could try the following patch. (Again, CAVEAT - untested! I'm not even
convinced it is correct - maybe the 'return' should be 'exit'? - but don't
have time to explore the logic further. Or to put it another way, I've
decided to live with the double emails until the next release comes
along!)
*** freshclam/execute.c.orig Sat Aug 16 18:18:00 2008
--- freshclam/execute.c Sun Oct 26 10:07:23 2008
***************
*** 54,61 ****
}
if(system(text) == -1) {
logg("%s: system(%s) failed\n", type, text);
- return;
}
}
#ifdef C_WINDOWS
--- 54,61 ----
}
if(system(text) == -1) {
logg("%s: system(%s) failed\n", type, text);
}
+ return;
}
#ifdef C_WINDOWS
***************
HTH,
Richard
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml