clamav-users August 2007 archive
Main Archive Page > Month Archives  > clamav-users archives
clamav-users: Re: [Clamav-users] Automatic reloading of signatur

Re: [Clamav-users] Automatic reloading of signature files

From: Dennis Peterson <dennispe_at_nospam>
Date: Fri Aug 31 2007 - 16:19:01 GMT
To: ClamAV users ML <clamav-users@lists.clamav.net>


Gerard wrote:
> On Friday August 31, 2007 at 09:24:03 (AM) Lyle Giese wrote:
>
> [snip]
>> But I also see in /var/log/messages, clamd doing a selfcheck on the >> databases every 30 minutes.
>
> [snip]
>
> I have nothing in the message log; however, I don't have clamd
> configured to use that log either. I am considering changing the
> config file and restarting the daemon and see what happens. It is my
> opinion, although I may be incorrect, that clamd only checks for the
> presents of updated clamd files and not third party definition files.
> I cannot seem to verify that however.
>

Here's a short Perl script that will send a reload command to a Unix socket. It also sends a ping to that same socket. The results of both commands are printed. The response should be:

RELOADING
PONG I probably found this in the contrib area of the source distribution, or a contributor's web site. It is useful as is but is intended as a demonstration only. It expects to find the clamd socket in /tmp so edit that to suit your own environment. Paste it into a file and chmod it 755 and see what happens:

#!/usr/local/bin/perl

use IO::Socket::UNIX;

$clamSocket = "/tmp/clamd.sock";
$timeout = 60;

$clamsock = new IO::Socket::UNIX(Type => SOCK_STREAM, Timeout => $timeout, Peer => $clamSocket );

$clamsock->send("RELOAD");
$clamsock->recv($err, 20);
print $err;
$err = "";
close ($clamsock);

$clamsock1 = new IO::Socket::UNIX(Type => SOCK_STREAM, Timeout => $timeout, Peer => $clamSocket );

$clamsock1->send("PING");
$clamsock1->recv($err, 20);
print $err;
close ($clamsock1);



Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html