ClamAV and freshclam

Graeme Nichols gnichols at tpg.com.au
Wed Feb 8 00:58:37 UTC 2006


karlp at ourldsfamily.com wrote:
> On Mon, February 6, 2006 7:13 pm, Graeme Nichols said:
> 
>>karlp at ourldsfamily.com wrote:
>>
>>>On Sun, February 5, 2006 10:33 pm, Graeme Nichols said:
>>>
>>>
>>>>Hello Folks,
>>>>
>>>>I have just installed clamav-0.88-1.fc4 on my laptop using 'yum install
>>>>clamav' and there is no freshclam command. Is this a 'feature' of this
>>>>version or have I made a mistake? I tried 'yum install freshclam' but it
>>>>reported 'No action needed' Or is the command to update the sig file
>>>>something different in this version? 'rpm -q clamav' states it contains a
>>>>tool for automatic updating via Internet. On my desktop there is a service
>>>>for automatically updating the sig file but not on my laptop after
>>>>installing
>>>>clamav.
>>>
>>>
>>>ClamAV is usually used as a gateway mail scanner. Freshclam is installed
>>>by
>>>default. Check /usr/local/bin/ for it. The clamav website has good docs on
>>>it, too. I have it on my email server and freshclam runs from rc.local on
>>>bootup with the following command:
>>>
>>>/usr/local/bin/freshclam -d --checks=50
>>>--daemon-notify="/usr/local/etc/clamd.conf"
>>>--on-update-execute="/home/karlp/bin/freshclam.sh update"
>>>--on-error-execute="/home/karlp/bin/freshclam.sh failed"
>>>--on-outdated-execute="/home/karlp/bin/freshclam.sh outdated" -u root
>>>
>>>That's all on one line, btw.
>>>
>>>HTH.
>>>
>>>Karl
>>
>>Hello again Karl,
>>
>>I downloaded the fc4 package from the clamav web site and installed it
>>after removing the package that yum installed. It installed just fine
>>and now I have freshclam and the freshclam service started.
>>
>>Thank you very much for your help.
> 
> 
> I just thought about the above startup options. Here's the freshclam.sh
> script I use with the 3 passed parameters shown in the startup:
> 
> #!/bin/bash
> usage () {
>  echo "Usage: freshclam.sh [update|failed|outdated]"
>  exit 1
> }
> if [ doo"$1" = 'doo' ] ; then
>   usage
> else
>  DO=$1
> fi
> perlcln () {
> RTN=`echo $V|perl -pe 's/%(..)/pack("c",hex($1))/eg'`
> RTN=$RTN$EM0
> }
> DATE=`date`
> "M0="
> EM2=`echo "Tail (-n10) of clamav.upd in /var/log/clamav"`
> cnt=7
> until [ $cnt -le 0 ]
>  do
>  CNT=`tail -n"$cnt" /var/log/clamav/clamav.upd|head -n1`
>  V=$CNT
>  perlcln
>  CNT=$RTN
>  echo $CNT >> /tmp/zzxxaa
>  cnt=$(($cnt-1))
> done
> FL=`cat /tmp/zzxxaa`
> if [ $DO = 'update' ] ; then
>     EM1=`printf "Freshclam update ran ($DATE)"`
>   elif [ $DO = 'failed' ] ; then
>     EM1=`printf "Freshclam update failed ($DATE)"`
>   else
>   usage
> fi
> EMALL=$EM1$EM0$EM0$EM2$EM0$EM3$EM0$FL
> echo $EMALL|mail -s "FreshClam $DO" karlp
> rm /tmp/zzxxaa
> exit 0
> 
> Yes, I know, it's not very elegant, but hey, I'm a problem solver, not a
> programmer and it seems to work... But, I'm not opposed to being told how to
> do it better. Any takers?
> 
> Karl

Hi Karl, like you, I am a problem solver not a programmer. I'll give it 
a go.

On my desktop system, FC4, I have a service called freshclam (Desktop 
--> System Settings --> Server Settings --> Services) that by ticking 
the box beside it and starting this service it will update the sig file 
using freshclam on a regular basis. It sets up cron etc.

The ClamAV package that was installed on my laptop by yum didn't have 
freshclam as part of the package (or if it did it didn't install it) but 
the package I downloaded from the clamAV web site did and now my laptop 
has the same setup as my desktop machine. I manually run clamscan -r 
--quiet ~/ each day. Works well. I could set up a cron job for it but I 
am lazy.

Thank you for your help.

-- 

----------------------------------------------------------------------
Kind regards,

Graeme.
----------------------------------------------------------------------

If you live long enough, you'll see that every victory turns into a defeat.
		-- Simone de Beauvoir




More information about the Redhat-install-list mailing list