On Thu, Aug 18, 2005 at 04:00:19PM +0200, Marc Haber said:
> Hi,
> 
> the clamd docs say quite clearly that it is necessary to either send
> the RELOAD command to the daemon or to send SIGUSR2 to the daemon to
> have it reload the database.

Or set SelfCheck in clamd.conf, but yes, the general idea is correct.

> However, the VERSION command and clamdscan -V report the new database
> version immediately after putting the new databases in place.

Both do indeed scan the on disk databases for version information.

> This looks to me like either
> (1) VERSION is lying and not reporting the database version that the
>     daemon actually uses or
> (2) RELOAD is unnecessary (at least in current daemon versions)
> 
> If (1) is correct, how do I find out which database version the daemon
> is using for scanning?
> 
> If (2) is correct, could please the docs be updated to clearly state
> that RELOAD is currently unneeded but might be neede in a future
> daemon version and that it is recommended that database RELOAD is
> issued to the daemon after touching the databases?
> 
> Thanks for the clarification.

The simplest to me seems to be to fix clamd to notice that a new
database may be ready when VERSION is sent.  Probably this is most
simply done by adding a case statement to clamd/server-th.c that handles
COMMAND_VERSION in the same way that COMMAND_RELOAD is handled.  This
way, you are assured that even if, at the moment, clamd is not using the
database on disk, it will be shortly. 

I suppose that an alternate implementation, using a version_mutex and a
root_mutex, would also work, but it seems like more overhead and more
prone to mutex lock issues.

clamdscan has no real way of knowing what the daemon is using, so
having it output the on disk version is the only thing that makes sense.
I suppose it could be reimplemented so that clamdscan -V contacted clamd
to get the version, but again, that seems like unnecessary overhead,
and would need a fallback in any case.
-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | If you're right 90% of the time, why    |
|  [EMAIL PROTECTED]             | quibble about the remaining 3%?         |
|  http://www.lobefin.net/~steve |                                         |
 --------------------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

_______________________________________________
http://lurker.clamav.net/list/clamav-users.html

Reply via email to