ahaer
05-25-2004, 10:59 AM
Newbie question:
Why does QMR do this in step 14??
Now I'm going to throw in a small customization to Clam AV...
mv /usr/bin/clamdscan /usr/bin/clamdscan.orig
ln -s /usr/bin/clamscan /usr/bin/clamdscan
It looks like they are replacing the server (clamd) / client (clamdscan) setup with a direct call to a simple program.
From what little I've read clamd/clamdscan is supposed to be much faster as it loads the virus file only once in the server.
I have been able to undo the customization and use clamd/clamdscan with the following script (/etc/init.d/clamd) that was adapted from http://www.falkotimme.com/howtos/spamassassin_clamav_procmail/index.php (changed /usr/local to /usr and removed --datadir option in start)
Note - This script also runs freshclam as a daemon that checks for updates 10 times a day (-c sets update frequency) so the cron job is not needed anymore...
#!/bin/bash
TMPDIR=/tmp
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin
case "$1" in
start)
echo "Starting ClamAV..."
if [ -S /tmp/clamd ]; then
echo "ClamAV is already running!"
else
/usr/bin/freshclam -d -c 10 -l /var/log/clam-update.log
/usr/sbin/clamd
fi
echo "ClamAV is now up and running!"
;;
stop)
echo "Shutting down ClamAV..."
array=(`ps ax | grep -iw '/usr/bin/freshclam' | grep -iv 'grep' \
| awk '{print $1}' | cut -f1 -d/ | tr '\n' ' '`)
element_count=${#array[@]}
index=0
while [ "$index" -lt "$element_count" ]
do
kill -9 ${array[$index]}
let "index = $index + 1"
done
array=(`ps ax | grep -iw '/usr/sbin/clamd' | grep -iv 'grep' \
| awk '{print $1}' | cut -f1 -d/ | tr '\n' ' '`)
element_count=${#array[@]}
index=0
while [ "$index" -lt "$element_count" ]
do
kill -9 ${array[$index]}
let "index = $index + 1"
done
if [ -S /tmp/clamd ]; then
rm -f /tmp/clamd
fi
echo "ClamAV stopped!"
;;
restart)
$0 stop && sleep 3
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
Why does QMR do this in step 14??
Now I'm going to throw in a small customization to Clam AV...
mv /usr/bin/clamdscan /usr/bin/clamdscan.orig
ln -s /usr/bin/clamscan /usr/bin/clamdscan
It looks like they are replacing the server (clamd) / client (clamdscan) setup with a direct call to a simple program.
From what little I've read clamd/clamdscan is supposed to be much faster as it loads the virus file only once in the server.
I have been able to undo the customization and use clamd/clamdscan with the following script (/etc/init.d/clamd) that was adapted from http://www.falkotimme.com/howtos/spamassassin_clamav_procmail/index.php (changed /usr/local to /usr and removed --datadir option in start)
Note - This script also runs freshclam as a daemon that checks for updates 10 times a day (-c sets update frequency) so the cron job is not needed anymore...
#!/bin/bash
TMPDIR=/tmp
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin
case "$1" in
start)
echo "Starting ClamAV..."
if [ -S /tmp/clamd ]; then
echo "ClamAV is already running!"
else
/usr/bin/freshclam -d -c 10 -l /var/log/clam-update.log
/usr/sbin/clamd
fi
echo "ClamAV is now up and running!"
;;
stop)
echo "Shutting down ClamAV..."
array=(`ps ax | grep -iw '/usr/bin/freshclam' | grep -iv 'grep' \
| awk '{print $1}' | cut -f1 -d/ | tr '\n' ' '`)
element_count=${#array[@]}
index=0
while [ "$index" -lt "$element_count" ]
do
kill -9 ${array[$index]}
let "index = $index + 1"
done
array=(`ps ax | grep -iw '/usr/sbin/clamd' | grep -iv 'grep' \
| awk '{print $1}' | cut -f1 -d/ | tr '\n' ' '`)
element_count=${#array[@]}
index=0
while [ "$index" -lt "$element_count" ]
do
kill -9 ${array[$index]}
let "index = $index + 1"
done
if [ -S /tmp/clamd ]; then
rm -f /tmp/clamd
fi
echo "ClamAV stopped!"
;;
restart)
$0 stop && sleep 3
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0