ClamAV and freshclam

karlp at ourldsfamily.com karlp at ourldsfamily.com
Tue Feb 7 06:54:48 UTC 2006


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


>
> --
>
> ----------------------------------------------------------------------
> Kind regards,
>
> Graeme.
> ----------------------------------------------------------------------
>
> I didn't believe in reincarnation in any of my other lives.  I don't see why
> I should have to believe in it in this one.
> 		-- Strange de Jim
>
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request at redhat.com
> Subject: unsubscribe
>


-- 
karl
     _/  _/      _/      _/_/_/       ____________   __o
    _/ _/       _/      _/    _/     ____________  _-\<._
   _/_/        _/      _/_/_/                     (_)/ (_)
  _/ _/       _/      _/           ......................
 _/   _/ arl _/_/_/  _/ earson    KarlP at ourldsfamily.com
---
Senior Consulting Sys/DB Analyst
http://consulting.ourldsfamily.com
---
 My Thoughts on Terrorism In America right after 9/11/2001:
 http://www.ourldsfamily.com/wtc.shtml
---
 A right is not what someone gives you; it's what no one can take from you.
 -Ramsey Clark
---





More information about the Redhat-install-list mailing list